zen-gitsync 2.12.9 → 2.13.3
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/package.json +1 -1
- package/scripts/README_COLOR_CONVERTER.md +196 -196
- package/scripts/README_FONTSIZE_CONVERTER.md +278 -278
- package/scripts/README_SPACING_CONVERTER.md +126 -126
- package/scripts/README_STYLE_VARS.md +180 -180
- package/src/ui/public/assets/EditorView-9Q0gSlr6.js +0 -0
- package/src/ui/public/assets/SourceMapView-Dxmg8KPB.js +3 -0
- package/src/ui/public/assets/WorkbenchView-CYC_l23l.js +2 -0
- package/src/ui/public/assets/WorkbenchView-DauLIzog.css +1 -0
- package/src/ui/public/assets/{_plugin-vue_export-helper-DMUTnP0C.js → _plugin-vue_export-helper-K0RsuraF.js} +3 -3
- package/src/ui/public/assets/{css.worker-Wv5dxAWO.js → css.worker-CvXBzhp8.js} +1 -1
- package/src/ui/public/assets/{html.worker-CQP8QQsS.js → html.worker-BO6WuOEO.js} +1 -1
- package/src/ui/public/assets/index-CGnU7zDA.js +66 -0
- package/src/ui/public/assets/index-DEEcURiV.css +1 -0
- package/src/ui/public/assets/{json.worker-DzV-CpCQ.js → json.worker-BkJRGcCJ.js} +1 -1
- package/src/ui/public/assets/{ts.worker-Dth06zuC.js → ts.worker-B0J26iPs.js} +15 -15
- package/src/ui/public/assets/vendor-DpYOE9sy.css +1 -0
- package/src/ui/public/assets/{vendor-C1sPhIEb.js → vendor-vsQ98rZk.js} +214 -207
- package/src/ui/public/favicon.svg +75 -75
- package/src/ui/public/index.html +23 -23
- package/src/ui/public/logo.svg +74 -74
- package/src/ui/server/routes/npm.js +170 -1
- package/src/ui/server/routes/workbench.js +1702 -1068
- package/src/ui/public/assets/EditorView-C4DezJRA.js +0 -0
- package/src/ui/public/assets/SourceMapView-B521sL_k.js +0 -3
- package/src/ui/public/assets/WorkbenchView-75x9qygA.js +0 -1
- package/src/ui/public/assets/WorkbenchView-Dc9vThI8.css +0 -1
- package/src/ui/public/assets/index-BCIFnj7e.css +0 -1
- package/src/ui/public/assets/index-cS1g7H--.js +0 -65
- package/src/ui/public/assets/vendor-B2yudN8R.css +0 -1
- /package/src/ui/public/assets/{editor.worker-Bd9IXS8d.js → editor.worker-Cn2oRESe.js} +0 -0
- /package/src/ui/public/assets/{rolldown-runtime-BM3Ffeng.js → rolldown-runtime-CMxvf4Kt.js} +0 -0
|
@@ -1,126 +1,126 @@
|
|
|
1
|
-
# 间距值转换工具使用说明
|
|
2
|
-
|
|
3
|
-
## 功能说明
|
|
4
|
-
|
|
5
|
-
该脚本将项目中 `padding`、`margin`、`gap` 属性中的 px 值转换为标准的 CSS 变量引用。
|
|
6
|
-
|
|
7
|
-
## 标准间距映射规则
|
|
8
|
-
|
|
9
|
-
根据项目中的 CSS 变量定义(`src/ui/client/src/styles/variables.scss`):
|
|
10
|
-
|
|
11
|
-
| 原始值 | 转换后 | CSS变量定义 |
|
|
12
|
-
|--------|--------|-------------|
|
|
13
|
-
| 2px | var(--spacing-xs) | 2px |
|
|
14
|
-
| 4px | var(--spacing-sm) | 4px |
|
|
15
|
-
| 8px | var(--spacing-base) | 8px |
|
|
16
|
-
| 12px | var(--spacing-md) | 12px |
|
|
17
|
-
| 16px | var(--spacing-lg) | 16px |
|
|
18
|
-
| 20px | var(--spacing-xl) | 20px |
|
|
19
|
-
| 24px | var(--spacing-2xl) | 24px |
|
|
20
|
-
| 32px | var(--spacing-3xl) | 32px |
|
|
21
|
-
|
|
22
|
-
### 保留的特殊值
|
|
23
|
-
|
|
24
|
-
以下值不会被转换,保持原样:
|
|
25
|
-
- **1px** - 通常用于边框
|
|
26
|
-
- **3px, 5px** - 特殊设计值
|
|
27
|
-
- **6px, 10px** - 常用于紧凑布局
|
|
28
|
-
- **18px** - 通常与字体相关
|
|
29
|
-
- **40px 及其他** - 特殊大间距值
|
|
30
|
-
|
|
31
|
-
## 使用方法
|
|
32
|
-
|
|
33
|
-
### 基本用法
|
|
34
|
-
|
|
35
|
-
```bash
|
|
36
|
-
# 在项目根目录执行
|
|
37
|
-
node scripts/convert-spacing-to-vars.js
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
### 转换示例
|
|
41
|
-
|
|
42
|
-
**转换前:**
|
|
43
|
-
```css
|
|
44
|
-
.example {
|
|
45
|
-
padding: 12px 16px;
|
|
46
|
-
margin: 8px;
|
|
47
|
-
gap: 16px;
|
|
48
|
-
}
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
**转换后:**
|
|
52
|
-
```css
|
|
53
|
-
.example {
|
|
54
|
-
padding: var(--spacing-md) var(--spacing-lg);
|
|
55
|
-
margin: var(--spacing-base);
|
|
56
|
-
gap: var(--spacing-lg);
|
|
57
|
-
}
|
|
58
|
-
```
|
|
59
|
-
|
|
60
|
-
**保留特殊值示例:**
|
|
61
|
-
```css
|
|
62
|
-
.example {
|
|
63
|
-
padding: 6px var(--spacing-md); /* 6px 保持不变 */
|
|
64
|
-
margin: 1px; /* 1px 保持不变(边框用途)*/
|
|
65
|
-
gap: var(--spacing-base); /* 8px 被转换 */
|
|
66
|
-
}
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
## 支持的文件类型
|
|
70
|
-
|
|
71
|
-
- `.vue` - Vue 单文件组件
|
|
72
|
-
- `.scss` - Sass 样式文件
|
|
73
|
-
- `.css` - 纯 CSS 文件
|
|
74
|
-
|
|
75
|
-
## 扫描范围
|
|
76
|
-
|
|
77
|
-
脚本会扫描 `src` 目录下的所有目标文件,自动跳过:
|
|
78
|
-
- `node_modules` 目录
|
|
79
|
-
- `.git` 目录
|
|
80
|
-
- `dist` 目录
|
|
81
|
-
|
|
82
|
-
## 输出报告
|
|
83
|
-
|
|
84
|
-
执行完成后会显示统计报告:
|
|
85
|
-
|
|
86
|
-
```
|
|
87
|
-
📊 转换统计报告
|
|
88
|
-
============================================================
|
|
89
|
-
总文件数: 150
|
|
90
|
-
修改文件数: 45
|
|
91
|
-
总替换次数: 234
|
|
92
|
-
|
|
93
|
-
📋 替换详情:
|
|
94
|
-
12px => var(--spacing-md): 89 次
|
|
95
|
-
16px => var(--spacing-lg): 67 次
|
|
96
|
-
8px => var(--spacing-base): 45 次
|
|
97
|
-
...
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
## 注意事项
|
|
101
|
-
|
|
102
|
-
1. **备份建议**:运行脚本前建议先提交或备份当前代码
|
|
103
|
-
2. **检查结果**:转换完成后请检查 Git diff,确认转换符合预期
|
|
104
|
-
3. **测试验证**:转换后请运行项目测试,确保样式显示正常
|
|
105
|
-
4. **混合值处理**:脚本能正确处理混合值,如 `padding: 6px var(--spacing-md)`
|
|
106
|
-
|
|
107
|
-
## 优势
|
|
108
|
-
|
|
109
|
-
使用 CSS 变量的好处:
|
|
110
|
-
|
|
111
|
-
1. **统一管理**:所有间距在 `variables.scss` 中统一定义
|
|
112
|
-
2. **易于维护**:修改变量值即可全局更新
|
|
113
|
-
3. **主题支持**:方便实现深色主题等样式变体
|
|
114
|
-
4. **语义化**:变量名更具可读性(如 `--spacing-md` vs `12px`)
|
|
115
|
-
|
|
116
|
-
## 回滚方法
|
|
117
|
-
|
|
118
|
-
如果需要回滚更改:
|
|
119
|
-
|
|
120
|
-
```bash
|
|
121
|
-
# 如果还未提交
|
|
122
|
-
git checkout -- src/
|
|
123
|
-
|
|
124
|
-
# 如果已提交
|
|
125
|
-
git revert <commit-hash>
|
|
126
|
-
```
|
|
1
|
+
# 间距值转换工具使用说明
|
|
2
|
+
|
|
3
|
+
## 功能说明
|
|
4
|
+
|
|
5
|
+
该脚本将项目中 `padding`、`margin`、`gap` 属性中的 px 值转换为标准的 CSS 变量引用。
|
|
6
|
+
|
|
7
|
+
## 标准间距映射规则
|
|
8
|
+
|
|
9
|
+
根据项目中的 CSS 变量定义(`src/ui/client/src/styles/variables.scss`):
|
|
10
|
+
|
|
11
|
+
| 原始值 | 转换后 | CSS变量定义 |
|
|
12
|
+
|--------|--------|-------------|
|
|
13
|
+
| 2px | var(--spacing-xs) | 2px |
|
|
14
|
+
| 4px | var(--spacing-sm) | 4px |
|
|
15
|
+
| 8px | var(--spacing-base) | 8px |
|
|
16
|
+
| 12px | var(--spacing-md) | 12px |
|
|
17
|
+
| 16px | var(--spacing-lg) | 16px |
|
|
18
|
+
| 20px | var(--spacing-xl) | 20px |
|
|
19
|
+
| 24px | var(--spacing-2xl) | 24px |
|
|
20
|
+
| 32px | var(--spacing-3xl) | 32px |
|
|
21
|
+
|
|
22
|
+
### 保留的特殊值
|
|
23
|
+
|
|
24
|
+
以下值不会被转换,保持原样:
|
|
25
|
+
- **1px** - 通常用于边框
|
|
26
|
+
- **3px, 5px** - 特殊设计值
|
|
27
|
+
- **6px, 10px** - 常用于紧凑布局
|
|
28
|
+
- **18px** - 通常与字体相关
|
|
29
|
+
- **40px 及其他** - 特殊大间距值
|
|
30
|
+
|
|
31
|
+
## 使用方法
|
|
32
|
+
|
|
33
|
+
### 基本用法
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# 在项目根目录执行
|
|
37
|
+
node scripts/convert-spacing-to-vars.js
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### 转换示例
|
|
41
|
+
|
|
42
|
+
**转换前:**
|
|
43
|
+
```css
|
|
44
|
+
.example {
|
|
45
|
+
padding: 12px 16px;
|
|
46
|
+
margin: 8px;
|
|
47
|
+
gap: 16px;
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
**转换后:**
|
|
52
|
+
```css
|
|
53
|
+
.example {
|
|
54
|
+
padding: var(--spacing-md) var(--spacing-lg);
|
|
55
|
+
margin: var(--spacing-base);
|
|
56
|
+
gap: var(--spacing-lg);
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**保留特殊值示例:**
|
|
61
|
+
```css
|
|
62
|
+
.example {
|
|
63
|
+
padding: 6px var(--spacing-md); /* 6px 保持不变 */
|
|
64
|
+
margin: 1px; /* 1px 保持不变(边框用途)*/
|
|
65
|
+
gap: var(--spacing-base); /* 8px 被转换 */
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## 支持的文件类型
|
|
70
|
+
|
|
71
|
+
- `.vue` - Vue 单文件组件
|
|
72
|
+
- `.scss` - Sass 样式文件
|
|
73
|
+
- `.css` - 纯 CSS 文件
|
|
74
|
+
|
|
75
|
+
## 扫描范围
|
|
76
|
+
|
|
77
|
+
脚本会扫描 `src` 目录下的所有目标文件,自动跳过:
|
|
78
|
+
- `node_modules` 目录
|
|
79
|
+
- `.git` 目录
|
|
80
|
+
- `dist` 目录
|
|
81
|
+
|
|
82
|
+
## 输出报告
|
|
83
|
+
|
|
84
|
+
执行完成后会显示统计报告:
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
📊 转换统计报告
|
|
88
|
+
============================================================
|
|
89
|
+
总文件数: 150
|
|
90
|
+
修改文件数: 45
|
|
91
|
+
总替换次数: 234
|
|
92
|
+
|
|
93
|
+
📋 替换详情:
|
|
94
|
+
12px => var(--spacing-md): 89 次
|
|
95
|
+
16px => var(--spacing-lg): 67 次
|
|
96
|
+
8px => var(--spacing-base): 45 次
|
|
97
|
+
...
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## 注意事项
|
|
101
|
+
|
|
102
|
+
1. **备份建议**:运行脚本前建议先提交或备份当前代码
|
|
103
|
+
2. **检查结果**:转换完成后请检查 Git diff,确认转换符合预期
|
|
104
|
+
3. **测试验证**:转换后请运行项目测试,确保样式显示正常
|
|
105
|
+
4. **混合值处理**:脚本能正确处理混合值,如 `padding: 6px var(--spacing-md)`
|
|
106
|
+
|
|
107
|
+
## 优势
|
|
108
|
+
|
|
109
|
+
使用 CSS 变量的好处:
|
|
110
|
+
|
|
111
|
+
1. **统一管理**:所有间距在 `variables.scss` 中统一定义
|
|
112
|
+
2. **易于维护**:修改变量值即可全局更新
|
|
113
|
+
3. **主题支持**:方便实现深色主题等样式变体
|
|
114
|
+
4. **语义化**:变量名更具可读性(如 `--spacing-md` vs `12px`)
|
|
115
|
+
|
|
116
|
+
## 回滚方法
|
|
117
|
+
|
|
118
|
+
如果需要回滚更改:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
# 如果还未提交
|
|
122
|
+
git checkout -- src/
|
|
123
|
+
|
|
124
|
+
# 如果已提交
|
|
125
|
+
git revert <commit-hash>
|
|
126
|
+
```
|
|
@@ -1,180 +1,180 @@
|
|
|
1
|
-
# CSS 样式变量标准化工具
|
|
2
|
-
|
|
3
|
-
## 功能说明
|
|
4
|
-
|
|
5
|
-
该脚本将项目中的 `border-radius` 和 `box-shadow` 值转换为标准的 CSS 变量引用。
|
|
6
|
-
|
|
7
|
-
## 转换规则
|
|
8
|
-
|
|
9
|
-
### border-radius 映射
|
|
10
|
-
|
|
11
|
-
| 原始值 | 转换后 | CSS变量定义 |
|
|
12
|
-
|--------|--------|-------------|
|
|
13
|
-
| 2px | var(--radius-xs) | 2px |
|
|
14
|
-
| 3px | var(--radius-sm) | 3px |
|
|
15
|
-
| 4px | var(--radius-base) | 4px |
|
|
16
|
-
| 6px | var(--radius-md) | 6px |
|
|
17
|
-
| 8px | var(--radius-lg) | 8px |
|
|
18
|
-
| 12px | var(--radius-xl) | 12px |
|
|
19
|
-
|
|
20
|
-
### box-shadow 映射
|
|
21
|
-
|
|
22
|
-
| 原始值 | 转换后 | 用途 |
|
|
23
|
-
|--------|--------|------|
|
|
24
|
-
| 0 1px 3px rgba(0, 0, 0, 0.04) | var(--shadow-sm) | 小阴影 |
|
|
25
|
-
| 0 1px 4px rgba(0, 0, 0, 0.04) | var(--shadow-base) | 基础阴影 |
|
|
26
|
-
| 0 2px 8px rgba(0, 0, 0, 0.08) | var(--shadow-md) | 中等阴影 |
|
|
27
|
-
| 0 4px 12px rgba(0, 0, 0, 0.08) | var(--shadow-lg) | 大阴影 |
|
|
28
|
-
| 0 8px 24px rgba(0, 0, 0, 0.12) | var(--shadow-xl) | 超大阴影 |
|
|
29
|
-
|
|
30
|
-
#### 模糊匹配规则
|
|
31
|
-
|
|
32
|
-
对于未精确匹配的 box-shadow 值,脚本会根据偏移量和模糊度智能选择:
|
|
33
|
-
|
|
34
|
-
- **小阴影** (--shadow-sm): offset ≤ 2px, blur ≤ 4px
|
|
35
|
-
- **中等阴影** (--shadow-md): offset 2-4px, blur 6-12px
|
|
36
|
-
- **大阴影** (--shadow-lg): offset 4-8px, blur 12-24px
|
|
37
|
-
|
|
38
|
-
## 使用方法
|
|
39
|
-
|
|
40
|
-
### 预览模式(推荐先运行)
|
|
41
|
-
|
|
42
|
-
```bash
|
|
43
|
-
# 预览将要进行的更改,不修改文件
|
|
44
|
-
node scripts/convert-to-standard-vars.js --dry-run
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
### 实际应用
|
|
48
|
-
|
|
49
|
-
```bash
|
|
50
|
-
# 应用更改到文件
|
|
51
|
-
node scripts/convert-to-standard-vars.js
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
## 转换示例
|
|
55
|
-
|
|
56
|
-
### border-radius 转换
|
|
57
|
-
|
|
58
|
-
**转换前:**
|
|
59
|
-
```css
|
|
60
|
-
.card {
|
|
61
|
-
border-radius: 8px;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.button {
|
|
65
|
-
border-radius: 6px;
|
|
66
|
-
}
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
**转换后:**
|
|
70
|
-
```css
|
|
71
|
-
.card {
|
|
72
|
-
border-radius: var(--radius-lg);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
.button {
|
|
76
|
-
border-radius: var(--radius-md);
|
|
77
|
-
}
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
### box-shadow 转换
|
|
81
|
-
|
|
82
|
-
**转换前:**
|
|
83
|
-
```css
|
|
84
|
-
.card {
|
|
85
|
-
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
.modal {
|
|
89
|
-
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
|
|
90
|
-
}
|
|
91
|
-
```
|
|
92
|
-
|
|
93
|
-
**转换后:**
|
|
94
|
-
```css
|
|
95
|
-
.card {
|
|
96
|
-
box-shadow: var(--shadow-md);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
.modal {
|
|
100
|
-
box-shadow: var(--shadow-lg);
|
|
101
|
-
}
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
## 支持的文件类型
|
|
105
|
-
|
|
106
|
-
- `.vue` - Vue 单文件组件
|
|
107
|
-
- `.scss` - Sass 样式文件
|
|
108
|
-
- `.css` - 纯 CSS 文件
|
|
109
|
-
|
|
110
|
-
## 扫描范围
|
|
111
|
-
|
|
112
|
-
脚本会扫描 `src` 目录下的所有目标文件,自动跳过:
|
|
113
|
-
- `node_modules` 目录
|
|
114
|
-
- `.git` 目录
|
|
115
|
-
- `dist` 目录
|
|
116
|
-
|
|
117
|
-
## 输出报告
|
|
118
|
-
|
|
119
|
-
执行完成后会显示详细的统计报告:
|
|
120
|
-
|
|
121
|
-
```
|
|
122
|
-
📊 转换统计报告
|
|
123
|
-
============================================================
|
|
124
|
-
总文件数: 150
|
|
125
|
-
修改文件数: 38
|
|
126
|
-
border-radius 替换次数: 67
|
|
127
|
-
box-shadow 替换次数: 42
|
|
128
|
-
|
|
129
|
-
📋 border-radius 替换详情:
|
|
130
|
-
8px => var(--radius-lg): 28 次
|
|
131
|
-
6px => var(--radius-md): 19 次
|
|
132
|
-
4px => var(--radius-base): 12 次
|
|
133
|
-
...
|
|
134
|
-
|
|
135
|
-
📋 box-shadow 替换详情:
|
|
136
|
-
0 2px 8px rgba(0, 0, 0, 0.08) => var(--shadow-md): 23 次
|
|
137
|
-
0 4px 12px rgba(0, 0, 0, 0.08) => var(--shadow-lg): 15 次
|
|
138
|
-
...
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
## 注意事项
|
|
142
|
-
|
|
143
|
-
1. **备份建议**:运行脚本前建议先使用 `--dry-run` 参数预览更改
|
|
144
|
-
2. **Git 提交**:建议在运行前提交当前代码,方便回滚
|
|
145
|
-
3. **检查结果**:转换完成后请检查 Git diff,确认转换符合预期
|
|
146
|
-
4. **测试验证**:转换后请运行项目测试,确保样式显示正常
|
|
147
|
-
|
|
148
|
-
## 优势
|
|
149
|
-
|
|
150
|
-
使用 CSS 变量的好处:
|
|
151
|
-
|
|
152
|
-
1. **统一管理**:所有样式值在 `variables.scss` 中统一定义
|
|
153
|
-
2. **易于维护**:修改变量值即可全局更新
|
|
154
|
-
3. **主题支持**:方便实现深色主题等样式变体
|
|
155
|
-
4. **语义化**:变量名更具可读性
|
|
156
|
-
5. **一致性**:确保整个项目使用统一的设计规范
|
|
157
|
-
|
|
158
|
-
## 回滚方法
|
|
159
|
-
|
|
160
|
-
如果需要回滚更改:
|
|
161
|
-
|
|
162
|
-
```bash
|
|
163
|
-
# 如果还未提交
|
|
164
|
-
git checkout -- src/
|
|
165
|
-
|
|
166
|
-
# 如果已提交
|
|
167
|
-
git revert <commit-hash>
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
## 组合使用
|
|
171
|
-
|
|
172
|
-
该脚本可以与间距转换脚本配合使用,实现完整的样式标准化:
|
|
173
|
-
|
|
174
|
-
```bash
|
|
175
|
-
# 1. 转换间距值
|
|
176
|
-
node scripts/convert-spacing-to-vars.js
|
|
177
|
-
|
|
178
|
-
# 2. 转换圆角和阴影
|
|
179
|
-
node scripts/convert-to-standard-vars.js
|
|
180
|
-
```
|
|
1
|
+
# CSS 样式变量标准化工具
|
|
2
|
+
|
|
3
|
+
## 功能说明
|
|
4
|
+
|
|
5
|
+
该脚本将项目中的 `border-radius` 和 `box-shadow` 值转换为标准的 CSS 变量引用。
|
|
6
|
+
|
|
7
|
+
## 转换规则
|
|
8
|
+
|
|
9
|
+
### border-radius 映射
|
|
10
|
+
|
|
11
|
+
| 原始值 | 转换后 | CSS变量定义 |
|
|
12
|
+
|--------|--------|-------------|
|
|
13
|
+
| 2px | var(--radius-xs) | 2px |
|
|
14
|
+
| 3px | var(--radius-sm) | 3px |
|
|
15
|
+
| 4px | var(--radius-base) | 4px |
|
|
16
|
+
| 6px | var(--radius-md) | 6px |
|
|
17
|
+
| 8px | var(--radius-lg) | 8px |
|
|
18
|
+
| 12px | var(--radius-xl) | 12px |
|
|
19
|
+
|
|
20
|
+
### box-shadow 映射
|
|
21
|
+
|
|
22
|
+
| 原始值 | 转换后 | 用途 |
|
|
23
|
+
|--------|--------|------|
|
|
24
|
+
| 0 1px 3px rgba(0, 0, 0, 0.04) | var(--shadow-sm) | 小阴影 |
|
|
25
|
+
| 0 1px 4px rgba(0, 0, 0, 0.04) | var(--shadow-base) | 基础阴影 |
|
|
26
|
+
| 0 2px 8px rgba(0, 0, 0, 0.08) | var(--shadow-md) | 中等阴影 |
|
|
27
|
+
| 0 4px 12px rgba(0, 0, 0, 0.08) | var(--shadow-lg) | 大阴影 |
|
|
28
|
+
| 0 8px 24px rgba(0, 0, 0, 0.12) | var(--shadow-xl) | 超大阴影 |
|
|
29
|
+
|
|
30
|
+
#### 模糊匹配规则
|
|
31
|
+
|
|
32
|
+
对于未精确匹配的 box-shadow 值,脚本会根据偏移量和模糊度智能选择:
|
|
33
|
+
|
|
34
|
+
- **小阴影** (--shadow-sm): offset ≤ 2px, blur ≤ 4px
|
|
35
|
+
- **中等阴影** (--shadow-md): offset 2-4px, blur 6-12px
|
|
36
|
+
- **大阴影** (--shadow-lg): offset 4-8px, blur 12-24px
|
|
37
|
+
|
|
38
|
+
## 使用方法
|
|
39
|
+
|
|
40
|
+
### 预览模式(推荐先运行)
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
# 预览将要进行的更改,不修改文件
|
|
44
|
+
node scripts/convert-to-standard-vars.js --dry-run
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### 实际应用
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
# 应用更改到文件
|
|
51
|
+
node scripts/convert-to-standard-vars.js
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## 转换示例
|
|
55
|
+
|
|
56
|
+
### border-radius 转换
|
|
57
|
+
|
|
58
|
+
**转换前:**
|
|
59
|
+
```css
|
|
60
|
+
.card {
|
|
61
|
+
border-radius: 8px;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.button {
|
|
65
|
+
border-radius: 6px;
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
**转换后:**
|
|
70
|
+
```css
|
|
71
|
+
.card {
|
|
72
|
+
border-radius: var(--radius-lg);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.button {
|
|
76
|
+
border-radius: var(--radius-md);
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### box-shadow 转换
|
|
81
|
+
|
|
82
|
+
**转换前:**
|
|
83
|
+
```css
|
|
84
|
+
.card {
|
|
85
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.modal {
|
|
89
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**转换后:**
|
|
94
|
+
```css
|
|
95
|
+
.card {
|
|
96
|
+
box-shadow: var(--shadow-md);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.modal {
|
|
100
|
+
box-shadow: var(--shadow-lg);
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## 支持的文件类型
|
|
105
|
+
|
|
106
|
+
- `.vue` - Vue 单文件组件
|
|
107
|
+
- `.scss` - Sass 样式文件
|
|
108
|
+
- `.css` - 纯 CSS 文件
|
|
109
|
+
|
|
110
|
+
## 扫描范围
|
|
111
|
+
|
|
112
|
+
脚本会扫描 `src` 目录下的所有目标文件,自动跳过:
|
|
113
|
+
- `node_modules` 目录
|
|
114
|
+
- `.git` 目录
|
|
115
|
+
- `dist` 目录
|
|
116
|
+
|
|
117
|
+
## 输出报告
|
|
118
|
+
|
|
119
|
+
执行完成后会显示详细的统计报告:
|
|
120
|
+
|
|
121
|
+
```
|
|
122
|
+
📊 转换统计报告
|
|
123
|
+
============================================================
|
|
124
|
+
总文件数: 150
|
|
125
|
+
修改文件数: 38
|
|
126
|
+
border-radius 替换次数: 67
|
|
127
|
+
box-shadow 替换次数: 42
|
|
128
|
+
|
|
129
|
+
📋 border-radius 替换详情:
|
|
130
|
+
8px => var(--radius-lg): 28 次
|
|
131
|
+
6px => var(--radius-md): 19 次
|
|
132
|
+
4px => var(--radius-base): 12 次
|
|
133
|
+
...
|
|
134
|
+
|
|
135
|
+
📋 box-shadow 替换详情:
|
|
136
|
+
0 2px 8px rgba(0, 0, 0, 0.08) => var(--shadow-md): 23 次
|
|
137
|
+
0 4px 12px rgba(0, 0, 0, 0.08) => var(--shadow-lg): 15 次
|
|
138
|
+
...
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## 注意事项
|
|
142
|
+
|
|
143
|
+
1. **备份建议**:运行脚本前建议先使用 `--dry-run` 参数预览更改
|
|
144
|
+
2. **Git 提交**:建议在运行前提交当前代码,方便回滚
|
|
145
|
+
3. **检查结果**:转换完成后请检查 Git diff,确认转换符合预期
|
|
146
|
+
4. **测试验证**:转换后请运行项目测试,确保样式显示正常
|
|
147
|
+
|
|
148
|
+
## 优势
|
|
149
|
+
|
|
150
|
+
使用 CSS 变量的好处:
|
|
151
|
+
|
|
152
|
+
1. **统一管理**:所有样式值在 `variables.scss` 中统一定义
|
|
153
|
+
2. **易于维护**:修改变量值即可全局更新
|
|
154
|
+
3. **主题支持**:方便实现深色主题等样式变体
|
|
155
|
+
4. **语义化**:变量名更具可读性
|
|
156
|
+
5. **一致性**:确保整个项目使用统一的设计规范
|
|
157
|
+
|
|
158
|
+
## 回滚方法
|
|
159
|
+
|
|
160
|
+
如果需要回滚更改:
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
# 如果还未提交
|
|
164
|
+
git checkout -- src/
|
|
165
|
+
|
|
166
|
+
# 如果已提交
|
|
167
|
+
git revert <commit-hash>
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
## 组合使用
|
|
171
|
+
|
|
172
|
+
该脚本可以与间距转换脚本配合使用,实现完整的样式标准化:
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
# 1. 转换间距值
|
|
176
|
+
node scripts/convert-spacing-to-vars.js
|
|
177
|
+
|
|
178
|
+
# 2. 转换圆角和阴影
|
|
179
|
+
node scripts/convert-to-standard-vars.js
|
|
180
|
+
```
|
|
Binary file
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{o as e}from"./rolldown-runtime-CMxvf4Kt.js";import{En as t,Fn as n,Gn as r,Jn as i,Kn as a,Ln as o,Mn as s,On as c,P as ee,Pn as l,Rn as u,Tn as d,Vn as f,Wn as p,Xn as m,_ as te,ar as h,c as g,cr as _,d as ne,er as re,f as ie,g as ae,gt as oe,h as se,jn as v,lr as y,m as ce,nr as b,or as le,p as ue,sr as x,t as de,tr as S,ur as C,v as fe,wn as pe,y as me,zn as w}from"./vendor-vsQ98rZk.js";import{n as T,t as E}from"./_plugin-vue_export-helper-K0RsuraF.js";import{a as he,r as ge}from"./index-CGnU7zDA.js";var _e=e(ne(),1),ve={class:`source-map-view`},ye={class:`sm-toolbar`},be={class:`sm-toolbar-left`},xe={class:`sm-title`},Se={class:`sm-toolbar-center`},Ce=[`placeholder`,`disabled`],we=[`disabled`],Te={class:`sm-toolbar-right`},Ee={class:`sm-body`},De={class:`sm-panel-header sm-panel-header--tabs`},Oe={key:0,class:`sm-badge`},ke={class:`sm-panel-body sm-file-tree`},Ae=[`onClick`],je={key:1,class:`sm-tree-arrow-spacer`},Me={key:2,class:`sm-tree-icon mit-icon`,"aria-hidden":`true`},Ne=[`xlink:href`],Pe={key:3,class:`sm-tree-icon mit-icon`,"aria-hidden":`true`},Fe=[`xlink:href`],Ie=[`title`],Le={key:1,class:`sm-tree-empty`},Re={class:`sm-panel-body sm-outline-body`},ze={class:`sm-badge`,style:{"margin-left":`auto`}},Be=[`onClick`],Ve=[`title`],He={key:0,class:`sm-outline-desc`},Ue={key:1,class:`sm-tree-empty`},We={class:`sm-panel sm-panel-graph`},Ge={key:0,class:`sm-project-info`},Ke={class:`sm-lang-badge`},qe={class:`sm-summary-text`},Je={class:`sm-graph-container`},Ye={class:`sm-layout-btn-wrap`},Xe=[`disabled`],Ze=[`title`],Qe={class:`sm-fn-label`},$e={key:0,class:`sm-fn-desc`},et={key:0,class:`sm-graph-empty`},tt={viewBox:`0 0 24 24`,width:`48`,height:`48`,fill:`none`,stroke:`currentColor`,"stroke-width":`1`,style:{opacity:`0.3`}},nt={key:1,class:`sm-graph-loading`},rt={class:`sm-log-header`},it={key:0,class:`sm-log-indicator`},at={class:`sm-log-body`,ref:`logBodyRef`},ot={key:0,class:`sm-empty`},st={class:`sm-panel-header`},ct={key:0,class:`sm-badge sm-badge-amber`},lt={key:0,class:`sm-node-detail`},ut={class:`sm-node-name`},dt={class:`sm-node-file`},ft={key:0},pt={key:0,class:`sm-node-desc`},mt={class:`sm-panel-body sm-source-body`},ht={key:0,class:`sm-source-overlay`},gt={key:1,class:`sm-source-overlay sm-source-placeholder`},D=E(f({__name:`SourceMapView`,setup(e){let f=h(document.documentElement.getAttribute(`data-theme`)===`dark`?`dark`:`light`);function ne(){f.value=document.documentElement.getAttribute(`data-theme`)===`dark`?`dark`:`light`}let E=null,D=he(),O=h(D.currentDirectory||``),k=h(`idle`),A=h([]),_t=0,j=h(null),M=h(null),N=h(`files`),P=h(``),F=h(``),I=h(!1),L=h([]),R=h(new Set),z=h({files:!0,graph:!0,source:!0}),B=h(!1),V=h(220),H=h(360),U=h(140),W=null,G=0,vt=0,K=0;function q(e,t){W=e,G=t.clientX,vt=t.clientY,K=e===`files`?V.value:e===`source`?H.value:U.value,document.addEventListener(`mousemove`,yt),document.addEventListener(`mouseup`,J),t.preventDefault()}function yt(e){W&&(W===`files`?V.value=Math.max(120,Math.min(480,K+e.clientX-G)):W===`source`?H.value=Math.max(200,Math.min(700,K+G-e.clientX)):U.value=Math.max(60,Math.min(500,K+vt-e.clientY)))}function J(){W=null,document.removeEventListener(`mousemove`,yt),document.removeEventListener(`mouseup`,J)}let Y=h(null),X=le(null),{fitView:bt,setNodes:xt,setEdges:St,getNodes:Ct,getEdges:wt,updateNodeInternals:Tt}=me(),Z=v(()=>k.value===`scanning`||k.value===`analyzing`),Et=v(()=>f.value===`dark`?`#334155`:`#cbd5e1`),Q=v(()=>j.value?.nodes.find(e=>e.id===M.value)??null),Dt=v(()=>{if(!j.value)return[];let e=new Map;for(let t of j.value.nodes){let n=t.subsystem??`__default__`;if(!e.has(n)){let r=j.value.subsystems?.find(e=>e.name===n);e.set(n,{displayName:r?.displayName||t.subsystem||T(`@SRCMAP:默认`),color:t.subsystemColor||kt[0],nodes:[]})}e.get(n).nodes.push(t)}return[...e.entries()].map(([,e])=>e)});function $(e,t=`info`){A.value.push({id:++_t,message:e,type:t,timestamp:Date.now()}),A.value.length>200&&A.value.splice(0,A.value.length-200)}function Ot(e){let t={name:``,path:``,kind:`dir`,children:[],childMap:new Map};for(let n of e){let e=n.trim().split(`/`).filter(Boolean),r=t,i=``;for(let t=0;t<e.length;t++){let n=e[t];i=i?`${i}/${n}`:n;let a=t===e.length-1,o=r.childMap.get(n);o||(o={name:n,path:i,kind:a?`file`:`dir`,children:[],childMap:new Map},r.childMap.set(n,o),r.children.push(o)),r=o}}let n=e=>{e.sort((e,t)=>e.kind===t.kind?e.name.localeCompare(t.name):e.kind===`dir`?-1:1),e.forEach(e=>{e.kind===`dir`&&n(e.children)})};return n(t.children),t.children}let kt=[`#f59e0b`,`#3b82f6`,`#10b981`,`#8b5cf6`];function At(e){return e.subsystemColor?e.subsystemColor:e.subsystemIndex===void 0?e.importance===`high`?`#f59e0b`:e.importance===`low`?`#94a3b8`:`#3b82f6`:kt[e.subsystemIndex%kt.length]}function jt(e){return{ts:`typescript`,tsx:`typescript`,js:`javascript`,mjs:`javascript`,cjs:`javascript`,jsx:`javascript`,vue:`html`,svelte:`html`,html:`html`,py:`python`,java:`java`,go:`go`,rs:`rust`,cpp:`cpp`,cc:`cpp`,cxx:`cpp`,c:`c`,h:`c`,hpp:`cpp`,cs:`csharp`,rb:`ruby`,php:`php`,swift:`swift`,kt:`kotlin`,sh:`shell`,bash:`shell`,json:`json`,yaml:`yaml`,yml:`yaml`,md:`markdown`,css:`css`,scss:`scss`,less:`less`,sql:`sql`}[e.split(`.`).pop()?.toLowerCase()||``]||`plaintext`}function Mt(){!Y.value||X.value||(X.value=g.create(Y.value,{value:``,language:`plaintext`,theme:f.value===`dark`?`vs-dark`:`vs`,readOnly:!0,fontSize:12,lineHeight:19,fontFamily:`'JetBrains Mono', 'Fira Code', Consolas, monospace`,minimap:{enabled:!1},scrollBeyondLastLine:!1,automaticLayout:!0,wordWrap:`off`,padding:{top:8,bottom:8},scrollbar:{verticalScrollbarSize:6,horizontalScrollbarSize:6}}))}re(f,e=>{X.value&&g.setTheme(e===`dark`?`vs-dark`:`vs`)});function Nt(e,t){let n={};t.forEach(e=>{n[e.source]||(n[e.source]=[]),n[e.source].push(e.target)});let r=new Map;e.forEach(e=>{let t=e.subsystem??`__default`;r.has(t)||r.set(t,[]),r.get(t).push(e)});let i=[],a=0;for(let[,e]of r){let t=new Set(e.map(e=>e.id)),r={},o=e.length?[e[0].id]:[];for(o[0]&&(r[o[0]]=0);o.length;){let e=o.shift();(n[e]||[]).filter(e=>t.has(e)).forEach(t=>{r[t]===void 0&&(r[t]=(r[e]??0)+1,o.push(t))})}let s={};e.forEach(e=>{let t=r[e.id]??0;s[t]=(s[t]||0)+1});let c={};e.forEach(e=>{let t=r[e.id]??0;c[t]=(c[t]??-1)+1;let n=c[t],o=s[t]??1,ee=a*600+n*220-(o-1)*220/2,l=t*110,u=At(e);i.push({id:e.id,type:`default`,position:{x:ee,y:l},label:e.label,class:`sm-fn-node`,data:{...e,_accentColor:u},style:{"--node-accent":u}})}),a++}return{flowNodes:i,flowEdges:t.map((e,t)=>({id:`e_${t}_${e.source}_${e.target}`,source:e.source,target:e.target,type:`smoothstep`,animated:!1,class:`sm-fn-edge`,markerEnd:{type:se.ArrowClosed}}))}}async function Pt(){let e=Ct.value,t=wt.value;if(e.length!==0){B.value=!0;try{await p(),await new Promise(e=>requestAnimationFrame(()=>e())),Tt(e.map(e=>e.id)),await new Promise(e=>requestAnimationFrame(()=>e()));let n=new Map;e.forEach(e=>{let t=e.data?.subsystem??`__default__`;n.has(t)||n.set(t,[]),n.get(t).push(e)});let r=new Map,i=0;for(let[,e]of n){let n=new _e.default.graphlib.Graph;n.setDefaultEdgeLabel(()=>({})),n.setGraph({rankdir:`TB`,nodesep:55,ranksep:75,marginx:40,marginy:40});let a=new Set(e.map(e=>e.id));e.forEach(e=>{let t=190,r=e.data?.description?68:48,i=document.querySelector(`.vue-flow__node[data-id="${e.id}"]`);i&&i.offsetWidth>0&&(t=i.offsetWidth,r=i.offsetHeight),n.setNode(e.id,{width:t,height:r})}),t.forEach(e=>{a.has(e.source)&&a.has(e.target)&&n.setEdge(e.source,e.target)}),_e.default.layout(n);let o=0;e.forEach(e=>{let t=n.node(e.id);t&&(r.set(e.id,{x:i+t.x-t.width/2,y:t.y-t.height/2}),o=Math.max(o,t.x+t.width/2))}),i+=o+120}xt(e.map(e=>({...e,position:r.get(e.id)??e.position}))),await p(),bt({padding:.18})}finally{B.value=!1}}}async function Ft(){if(!O.value.trim()){ee.warning(T(`@SRCMAP:请先输入项目路径`));return}if(!Z.value){A.value=[],j.value=null,M.value=null,P.value=``,F.value=``,xt([]),St([]),k.value=`scanning`,$(T(`@SRCMAP:开始分析项目...`),`info`);try{let e=await fetch(`/api/code-analysis/analyze`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:O.value})});if(!e.ok){let t=await e.json().catch(()=>({error:`请求失败`}));throw Error(t.error||`HTTP ${e.status}`)}let t=e.body.getReader(),n=new TextDecoder,r=``;k.value=`analyzing`;let i=``,a=[];for(;;){let{done:e,value:o}=await t.read();if(e)break;r+=n.decode(o,{stream:!0});let s=r.split(`
|
|
2
|
+
`);r=s.pop()??``;for(let e of s)if(e.startsWith(`event:`))i=e.slice(6).trim(),a=[];else if(e.startsWith(`data:`))a.push(e.slice(5).trim());else if(e===``){if(i&&a.length){let e=a.join(``);try{let t=JSON.parse(e);It(i,t)}catch{}}i=``,a=[]}}}catch(e){$(`${T(`@SRCMAP:分析失败`)}: ${e.message}`,`error`),k.value=`error`}}}function It(e,t){if(e===`log`)$(t.message,t.type||`info`);else if(e===`files`)L.value=Ot(t.files||[]),L.value.forEach(e=>{e.kind===`dir`&&R.value.add(e.path)});else if(e===`result`){j.value={language:t.language||``,entryFile:t.entryFile||``,entryFunction:t.entryFunction||``,nodes:Array.isArray(t.nodes)?t.nodes:[],edges:Array.isArray(t.edges)?t.edges:[],techStack:Array.isArray(t.techStack)?t.techStack:[],summary:t.summary||``,allFiles:Array.isArray(t.allFiles)?t.allFiles:[],codeFiles:Array.isArray(t.codeFiles)?t.codeFiles:[],subsystems:Array.isArray(t.subsystems)?t.subsystems:void 0};let{flowNodes:e,flowEdges:n}=Nt(j.value.nodes,j.value.edges);xt(e),St(n),p(()=>Pt())}else e===`done`&&(t.error?($(`${T(`@SRCMAP:分析失败`)}: ${t.error}`,`error`),k.value=`error`):k.value=`done`)}async function Lt(e){if(!(!e||I.value)&&F.value!==e){I.value=!0,F.value=e,P.value=``;try{let t=await(await fetch(`/api/code-analysis/file-content?path=${encodeURIComponent(O.value)}&file=${encodeURIComponent(e)}`)).json();if(t.error)throw Error(t.error);P.value=t.content||``}catch(e){P.value=`// ${T(`@SRCMAP:加载失败`)}: ${e.message}`}finally{I.value=!1}}}function Rt(e){let t=e.node.data;M.value=t.id,t.file&&Lt(t.file)}function zt(e){R.value.has(e)?R.value.delete(e):R.value.add(e)}let Bt=v(()=>{let e=[];function t(n,r){for(let i of n){let n=R.value.has(i.path);e.push({name:i.name,path:i.path,kind:i.kind,depth:r,expanded:n}),i.kind===`dir`&&n&&t(i.children,r+1)}}return t(L.value,0),e});return re(()=>D.currentDirectory,e=>{e&&!O.value&&(O.value=e)}),re([P,F],([e,t])=>{let n=X.value;if(!n)return;let r=jt(t||``),i=n.getModel(),a=g.createModel(e||``,r);n.setModel(a),i?.dispose(),n.setScrollPosition({scrollTop:0,scrollLeft:0})}),a(()=>{Mt(),!O.value&&D.currentDirectory&&(O.value=D.currentDirectory),E=new MutationObserver(()=>ne()),E.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-theme`]})}),r(()=>{X.value?.getModel()?.dispose(),X.value?.dispose(),J(),E?.disconnect(),E=null}),(e,r)=>{let a=oe;return i(),n(`div`,ve,[s(`div`,ye,[s(`div`,be,[r[9]||=s(`svg`,{viewBox:`0 0 24 24`,width:`18`,height:`18`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.8`,class:`sm-icon-map`},[s(`polygon`,{points:`3 6 9 3 15 6 21 3 21 18 15 21 9 18 3 21`}),s(`line`,{x1:`9`,y1:`3`,x2:`9`,y2:`18`}),s(`line`,{x1:`15`,y1:`6`,x2:`15`,y2:`21`})],-1),s(`span`,xe,C(x(T)(`@SRCMAP:源码地图`)),1)]),s(`div`,Se,[b(s(`input`,{"onUpdate:modelValue":r[0]||=e=>O.value=e,class:`sm-path-input`,placeholder:x(T)(`@SRCMAP:输入项目目录路径`),disabled:Z.value,onKeydown:t(Ft,[`enter`])},null,40,Ce),[[pe,O.value]]),s(`button`,{class:`sm-btn sm-btn-primary`,disabled:Z.value,onClick:Ft},[Z.value?(i(),n(c,{key:0},[r[10]||=s(`span`,{class:`sm-spinner`},null,-1),u(` `+C(x(T)(`@SRCMAP:分析中...`)),1)],64)):(i(),n(c,{key:1},[u(C(k.value===`done`?x(T)(`@SRCMAP:重新分析`):x(T)(`@SRCMAP:开始分析`)),1)],64))],8,we)]),s(`div`,Te,[w(a,{content:x(T)(`@SRCMAP:文件列表`),placement:`bottom`},{default:S(()=>[s(`button`,{class:_([`sm-panel-btn`,{active:z.value.files}]),onClick:r[1]||=e=>z.value.files=!z.value.files},[...r[11]||=[s(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.8`},[s(`path`,{d:`M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z`})],-1)]],2)]),_:1},8,[`content`]),w(a,{content:x(T)(`@SRCMAP:调用图`),placement:`bottom`},{default:S(()=>[s(`button`,{class:_([`sm-panel-btn`,{active:z.value.graph}]),onClick:r[2]||=e=>z.value.graph=!z.value.graph},[...r[12]||=[s(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.8`},[s(`circle`,{cx:`12`,cy:`12`,r:`3`}),s(`circle`,{cx:`3`,cy:`6`,r:`2`}),s(`circle`,{cx:`21`,cy:`6`,r:`2`}),s(`circle`,{cx:`3`,cy:`18`,r:`2`}),s(`circle`,{cx:`21`,cy:`18`,r:`2`}),s(`line`,{x1:`5`,y1:`6`,x2:`9`,y2:`11`}),s(`line`,{x1:`19`,y1:`6`,x2:`15`,y2:`11`}),s(`line`,{x1:`5`,y1:`18`,x2:`9`,y2:`13`}),s(`line`,{x1:`19`,y1:`18`,x2:`15`,y2:`13`})],-1)]],2)]),_:1},8,[`content`]),w(a,{content:x(T)(`@SRCMAP:源码面板`),placement:`bottom`},{default:S(()=>[s(`button`,{class:_([`sm-panel-btn`,{active:z.value.source}]),onClick:r[3]||=e=>z.value.source=!z.value.source},[...r[13]||=[s(`svg`,{viewBox:`0 0 24 24`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.8`},[s(`polyline`,{points:`16 18 22 12 16 6`}),s(`polyline`,{points:`8 6 2 12 8 18`})],-1)]],2)]),_:1},8,[`content`])])]),s(`div`,Ee,[b(s(`div`,{class:`sm-panel sm-panel-files`,style:y({width:V.value+`px`})},[s(`div`,De,[s(`button`,{class:_([`sm-tab-btn`,{active:N.value===`files`}]),onClick:r[4]||=e=>N.value=`files`},[r[14]||=s(`svg`,{viewBox:`0 0 24 24`,width:`12`,height:`12`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.8`},[s(`path`,{d:`M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z`})],-1),u(` `+C(x(T)(`@SRCMAP:文件列表`))+` `,1),j.value?(i(),n(`span`,Oe,C(j.value.allFiles.length),1)):l(``,!0)],2),s(`button`,{class:_([`sm-tab-btn`,{active:N.value===`outline`}]),onClick:r[5]||=e=>N.value=`outline`},[r[15]||=o(`<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="1.8" data-v-71d3569e><line x1="8" y1="6" x2="21" y2="6" data-v-71d3569e></line><line x1="8" y1="12" x2="21" y2="12" data-v-71d3569e></line><line x1="8" y1="18" x2="21" y2="18" data-v-71d3569e></line><line x1="3" y1="6" x2="3.01" y2="6" data-v-71d3569e></line><line x1="3" y1="12" x2="3.01" y2="12" data-v-71d3569e></line><line x1="3" y1="18" x2="3.01" y2="18" data-v-71d3569e></line></svg>`,1),u(` `+C(x(T)(`@SRCMAP:大纲`)),1)],2)]),b(s(`div`,ke,[Bt.value.length>0?(i(!0),n(c,{key:0},m(Bt.value,e=>(i(),n(`div`,{key:e.path,class:_([`sm-tree-node`,{"sm-tree-node--dir":e.kind===`dir`,"sm-tree-node--active":e.kind===`file`&&F.value===e.path}]),style:y({paddingLeft:10+e.depth*14+`px`}),onClick:t=>e.kind===`dir`?zt(e.path):Lt(e.path)},[e.kind===`dir`?(i(),n(`span`,{key:0,class:_([`sm-tree-arrow`,{expanded:e.expanded}])},[...r[16]||=[s(`svg`,{viewBox:`0 0 24 24`,width:`10`,height:`10`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[s(`polyline`,{points:`9 18 15 12 9 6`})],-1)]],2)):(i(),n(`span`,je)),e.kind===`dir`?(i(),n(`svg`,Me,[s(`use`,{"xlink:href":`#${x(ge)(e.name)||`icon-folder`}`},null,8,Ne)])):(i(),n(`svg`,Pe,[s(`use`,{"xlink:href":`#${x(ge)(e.name)}`},null,8,Fe)])),s(`span`,{class:`sm-tree-name`,title:e.path},C(e.name),9,Ie)],14,Ae))),128)):(i(),n(`div`,Le,C(x(T)(`@SRCMAP:暂无文件,请先开始分析`)),1))],512),[[d,N.value===`files`]]),b(s(`div`,Re,[Dt.value.length>0?(i(!0),n(c,{key:0},m(Dt.value,e=>(i(),n(`div`,{key:e.displayName,class:`sm-outline-group`},[s(`div`,{class:`sm-outline-group-header`,style:y({color:e.color})},[r[17]||=s(`svg`,{viewBox:`0 0 24 24`,width:`8`,height:`8`,fill:`currentColor`},[s(`circle`,{cx:`12`,cy:`12`,r:`6`})],-1),u(` `+C(e.displayName)+` `,1),s(`span`,ze,C(e.nodes.length),1)],4),(i(!0),n(c,null,m(e.nodes,t=>(i(),n(`div`,{key:t.id,class:_([`sm-outline-node`,{"sm-outline-node--active":M.value===t.id}]),onClick:e=>{M.value=t.id,t.file&&Lt(t.file)}},[s(`span`,{class:`sm-outline-dot`,style:y({background:e.color})},null,4),s(`span`,{class:`sm-outline-label`,title:t.file||t.label},C(t.label),9,Ve),t.description?(i(),n(`span`,He,C(t.description.length>18?t.description.slice(0,18)+`…`:t.description),1)):l(``,!0)],10,Be))),128))]))),128)):(i(),n(`div`,Ue,C(x(T)(`@SRCMAP:暂无分析结果`)),1))],512),[[d,N.value===`outline`]])],4),[[d,z.value.files]]),b(s(`div`,{class:`sm-resizer sm-resizer-v`,onMousedown:r[6]||=e=>q(`files`,e)},null,544),[[d,z.value.files&&z.value.graph]]),b(s(`div`,We,[j.value?(i(),n(`div`,Ge,[s(`span`,Ke,C(j.value.language),1),j.value.subsystems&&j.value.subsystems.length>1?(i(!0),n(c,{key:0},m(j.value.subsystems,e=>(i(),n(`span`,{key:e.name,class:`sm-subsystem-tag`,style:y({borderColor:e.color,color:e.color})},`● `+C(e.displayName||e.name),5))),128)):(i(!0),n(c,{key:1},m(j.value.techStack.slice(0,4),e=>(i(),n(`span`,{key:e,class:`sm-tech-tag`},C(e),1))),128)),s(`span`,qe,C(j.value.summary),1)])):l(``,!0),s(`div`,Je,[s(`div`,Ye,[s(`button`,{class:`sm-layout-btn`,disabled:B.value||!j.value,onClick:Pt},[r[18]||=o(`<svg viewBox="0 0 24 24" width="12" height="12" fill="none" stroke="currentColor" stroke-width="1.8" data-v-71d3569e><rect x="3" y="3" width="7" height="7" rx="1" data-v-71d3569e></rect><rect x="14" y="3" width="7" height="7" rx="1" data-v-71d3569e></rect><rect x="3" y="14" width="7" height="7" rx="1" data-v-71d3569e></rect><rect x="14" y="14" width="7" height="7" rx="1" data-v-71d3569e></rect></svg>`,1),u(` `+C(B.value?x(T)(`@SRCMAP:布局中...`):x(T)(`@SRCMAP:优化布局`)),1)],8,Xe)]),w(x(te),{class:`sm-vue-flow`,"default-viewport":{zoom:1},"min-zoom":.2,"max-zoom":4,"fit-view-on-init":``,onNodeClick:Rt},{"node-default":S(({data:e,label:t})=>[w(x(fe),{type:`target`,position:x(ae).Top},null,8,[`position`]),s(`div`,{class:`sm-fn-inner`,title:`${t}${e?.description?`
|
|
3
|
+
`+e.description:``}`},[s(`div`,Qe,C(t),1),e?.description?(i(),n(`div`,$e,C(e.description.length>22?e.description.slice(0,22)+`…`:e.description),1)):l(``,!0)],8,Ze),w(x(fe),{type:`source`,position:x(ae).Bottom},null,8,[`position`])]),default:S(()=>[w(x(ce),{variant:x(ue).Dots,gap:20,size:1,"pattern-color":Et.value},null,8,[`variant`,`pattern-color`]),w(x(ie)),w(x(de),{"node-color":`#3b82f6`,"mask-color":f.value===`dark`?`rgba(0,0,0,0.55)`:`rgba(15,23,42,0.06)`},null,8,[`mask-color`])]),_:1}),!j.value&&!Z.value?(i(),n(`div`,et,[(i(),n(`svg`,tt,[...r[19]||=[s(`polygon`,{points:`3 6 9 3 15 6 21 3 21 18 15 21 9 18 3 21`},null,-1),s(`line`,{x1:`9`,y1:`3`,x2:`9`,y2:`18`},null,-1),s(`line`,{x1:`15`,y1:`6`,x2:`15`,y2:`21`},null,-1)]])),s(`p`,null,C(x(T)(`@SRCMAP:输入项目路径后点击开始分析`)),1)])):l(``,!0),Z.value&&!j.value?(i(),n(`div`,nt,[r[20]||=s(`span`,{class:`sm-spinner sm-spinner-lg`},null,-1),s(`p`,null,C(x(T)(`@SRCMAP:AI 正在分析项目结构...`)),1)])):l(``,!0)]),s(`div`,{class:`sm-resizer sm-resizer-h`,onMousedown:r[7]||=e=>q(`log`,e)},null,32),s(`div`,{class:`sm-log-panel`,style:y({height:U.value+`px`})},[s(`div`,rt,[r[21]||=s(`svg`,{viewBox:`0 0 24 24`,width:`12`,height:`12`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.8`},[s(`polyline`,{points:`4 17 10 11 4 5`}),s(`line`,{x1:`12`,y1:`19`,x2:`20`,y2:`19`})],-1),u(` `+C(x(T)(`@SRCMAP:Agent 日志`))+` `,1),Z.value?(i(),n(`span`,it)):l(``,!0)]),s(`div`,at,[(i(!0),n(c,null,m(A.value.slice(-50),e=>(i(),n(`div`,{key:e.id,class:_([`sm-log-entry`,`sm-log-entry--${e.type}`])},C(e.message),3))),128)),A.value.length===0?(i(),n(`div`,ot,C(x(T)(`@SRCMAP:等待开始分析`)),1)):l(``,!0)],512)],4)],512),[[d,z.value.graph]]),b(s(`div`,{class:`sm-resizer sm-resizer-v`,onMousedown:r[8]||=e=>q(`source`,e)},null,544),[[d,z.value.graph&&z.value.source]]),b(s(`div`,{class:`sm-panel sm-panel-source`,style:y({width:H.value+`px`})},[s(`div`,st,[r[22]||=s(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.8`},[s(`polyline`,{points:`16 18 22 12 16 6`}),s(`polyline`,{points:`8 6 2 12 8 18`})],-1),u(` `+C(F.value||x(T)(`@SRCMAP:源码面板`))+` `,1),Q.value?(i(),n(`span`,ct,C(Q.value.label),1)):l(``,!0)]),Q.value?(i(),n(`div`,lt,[s(`div`,ut,C(Q.value.label),1),s(`div`,dt,[u(C(Q.value.file),1),Q.value.line?(i(),n(`span`,ft,` :`+C(Q.value.line),1)):l(``,!0)]),Q.value.description?(i(),n(`div`,pt,C(Q.value.description),1)):l(``,!0)])):l(``,!0),s(`div`,mt,[I.value?(i(),n(`div`,ht,[...r[23]||=[s(`span`,{class:`sm-spinner`},null,-1)]])):l(``,!0),!I.value&&!P.value?(i(),n(`div`,gt,C(x(T)(`@SRCMAP:点击调用图中的节点查看源码`)),1)):l(``,!0),s(`div`,{ref_key:`monacoContainerRef`,ref:Y,class:`sm-monaco-container`},null,512)])],4),[[d,z.value.source]])])])}}}),[[`__scopeId`,`data-v-71d3569e`]]);export{D as default};
|