@yuhufe/wtool-vdiff 0.0.6 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +140 -41
- package/dist/DiffFiles/DiffFiles.vue.d.ts +12 -0
- package/dist/DiffFiles/DiffList/DiffList.vue.d.ts +94 -0
- package/dist/DiffFiles/FileExplore/FileExplore.vue.d.ts +510 -0
- package/dist/DiffFiles/FileExplore/FileSearch.vue.d.ts +11 -0
- package/dist/DiffFiles/FileExplore/fileTree.d.ts +17 -0
- package/dist/DiffFiles/createDiffFiles.d.ts +13 -0
- package/dist/DiffFiles/index.d.ts +3 -0
- package/dist/DiffFiles/types.d.ts +12 -0
- package/dist/DiffFiles/useDiffFiles.d.ts +23 -0
- package/dist/DiffViewer/DiffViewer.vue.d.ts +15 -4
- package/dist/DiffViewer/MonacoDiffViewer.vue.d.ts +1 -1
- package/dist/DiffViewer/TopBar.vue.d.ts +2 -0
- package/dist/DiffViewer/const.d.ts +8 -0
- package/dist/DiffViewer/utils/autoHeight.d.ts +4 -1
- package/dist/DiffViewer/utils/patch2Pair.d.ts +9 -14
- package/dist/index.d.ts +1 -0
- package/dist/types.d.ts +16 -0
- package/dist/utils/patch.d.ts +20 -0
- package/dist/wtool-vdiff.cjs.js +45 -36
- package/dist/wtool-vdiff.es.js +9535 -5984
- package/package.json +10 -9
- package/src/DiffFiles/DiffFiles.vue +126 -0
- package/src/DiffFiles/DiffList/DiffList.vue +125 -0
- package/src/DiffFiles/FileExplore/FileExplore.vue +181 -0
- package/src/DiffFiles/FileExplore/FileSearch.vue +81 -0
- package/src/DiffFiles/FileExplore/fileTree.ts +102 -0
- package/src/DiffFiles/createDiffFiles.ts +70 -0
- package/src/DiffFiles/index.ts +11 -0
- package/src/DiffFiles/types.ts +15 -0
- package/src/DiffFiles/useDiffFiles.ts +56 -0
- package/src/DiffViewer/DiffViewer.vue +28 -7
- package/src/DiffViewer/MonacoDiffViewer.vue +21 -2
- package/src/DiffViewer/TopBar.vue +25 -6
- package/src/DiffViewer/const.ts +11 -0
- package/src/DiffViewer/utils/autoHeight.ts +159 -43
- package/src/DiffViewer/utils/patch2Pair.ts +37 -56
- package/src/assets/file.svg +4 -0
- package/src/assets/folder.svg +4 -0
- package/src/index.ts +1 -0
- package/src/types.ts +19 -0
- package/src/utils/patch.ts +74 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { defineCustomElement } from 'vue'
|
|
2
|
+
import type { WtoolDiffFilesProps } from '../types'
|
|
3
|
+
import DiffFiles from './DiffFiles.vue'
|
|
4
|
+
import type { DiffFileSelection } from './FileExplore/fileTree'
|
|
5
|
+
|
|
6
|
+
export type DiffFilesProps = WtoolDiffFilesProps
|
|
7
|
+
export type DiffFilesSelectFileListener = (selection: DiffFileSelection) => void
|
|
8
|
+
|
|
9
|
+
export const WTOOL_DIFF_FILES_TAG = 'wtool-diff-files'
|
|
10
|
+
|
|
11
|
+
export const WtoolDiffFiles = defineCustomElement(DiffFiles, {
|
|
12
|
+
shadowRoot: false,
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
export function register(tagName: string = WTOOL_DIFF_FILES_TAG): void {
|
|
16
|
+
if (customElements.get(tagName)) return
|
|
17
|
+
customElements.define(tagName, WtoolDiffFiles)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface DiffFilesInstance {
|
|
21
|
+
update(props: Partial<DiffFilesProps>): void
|
|
22
|
+
onSelectFile(listener: DiffFilesSelectFileListener): () => void
|
|
23
|
+
destroy(): void
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function applyProps(el: InstanceType<typeof WtoolDiffFiles>, props: Partial<DiffFilesProps>): void {
|
|
27
|
+
const node = el as unknown as Record<string, unknown>
|
|
28
|
+
for (const key of Object.keys(props) as (keyof DiffFilesProps)[]) {
|
|
29
|
+
const value = props[key]
|
|
30
|
+
if (value !== undefined) {
|
|
31
|
+
node[key as string] = value
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function createDiffFiles(target: HTMLElement, initialProps: DiffFilesProps = {}): DiffFilesInstance {
|
|
37
|
+
register()
|
|
38
|
+
const el = new WtoolDiffFiles()
|
|
39
|
+
const selectFileListeners = new Set<EventListener>()
|
|
40
|
+
|
|
41
|
+
applyProps(el, initialProps)
|
|
42
|
+
target.appendChild(el)
|
|
43
|
+
|
|
44
|
+
return {
|
|
45
|
+
update(newProps: Partial<DiffFilesProps>) {
|
|
46
|
+
applyProps(el, newProps)
|
|
47
|
+
},
|
|
48
|
+
onSelectFile(listener: DiffFilesSelectFileListener) {
|
|
49
|
+
const eventListener: EventListener = event => {
|
|
50
|
+
const [selection] = (event as CustomEvent<[DiffFileSelection]>).detail
|
|
51
|
+
listener(selection)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
selectFileListeners.add(eventListener)
|
|
55
|
+
el.addEventListener('select-file', eventListener)
|
|
56
|
+
|
|
57
|
+
return () => {
|
|
58
|
+
selectFileListeners.delete(eventListener)
|
|
59
|
+
el.removeEventListener('select-file', eventListener)
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
destroy() {
|
|
63
|
+
selectFileListeners.forEach(listener => {
|
|
64
|
+
el.removeEventListener('select-file', listener)
|
|
65
|
+
})
|
|
66
|
+
selectFileListeners.clear()
|
|
67
|
+
el.remove()
|
|
68
|
+
},
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export {
|
|
2
|
+
WTOOL_DIFF_FILES_TAG,
|
|
3
|
+
WtoolDiffFiles,
|
|
4
|
+
register as registerDiffFiles,
|
|
5
|
+
createDiffFiles,
|
|
6
|
+
type DiffFilesProps,
|
|
7
|
+
type DiffFilesInstance,
|
|
8
|
+
type DiffFilesSelectFileListener,
|
|
9
|
+
} from './createDiffFiles'
|
|
10
|
+
export type { DiffFileSelection } from './FileExplore/fileTree'
|
|
11
|
+
export type { DiffFile, FileTree, WtoolDiffFilesProps, WtoolDiffViewerStyle } from '../types'
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { DiffFile } from '../types'
|
|
2
|
+
|
|
3
|
+
// 文件列表的每个文件类型
|
|
4
|
+
export interface FileItem extends DiffFile {
|
|
5
|
+
fullPath: string
|
|
6
|
+
name: string
|
|
7
|
+
folderPath: string
|
|
8
|
+
type?: string
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface DiffFileState {
|
|
12
|
+
height: number
|
|
13
|
+
viewed: boolean
|
|
14
|
+
rawed: boolean
|
|
15
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { useCompExp } from '@yuhufe/web-ui'
|
|
2
|
+
import type { Ref } from 'vue'
|
|
3
|
+
|
|
4
|
+
import { DiffFile } from '@/types'
|
|
5
|
+
import { parsePatchFilenames } from '@/utils/patch'
|
|
6
|
+
import type { FileItem } from './types'
|
|
7
|
+
|
|
8
|
+
export const useDiffFiles = function ({ isMaster = false } = {}) {
|
|
9
|
+
const exp = useCompExp<{
|
|
10
|
+
selectedFileKey: Ref<string>
|
|
11
|
+
searchKeyword: Ref<string>
|
|
12
|
+
selectFile: (fullPath: string) => Promise<void>
|
|
13
|
+
filterTree: (keyword: string) => void
|
|
14
|
+
}>({ isMaster, key: 'diffFiles' })
|
|
15
|
+
|
|
16
|
+
return { ...exp }
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function formatDiffFiles(diffFiles: DiffFile[]) {
|
|
20
|
+
function resolveDiffFileFullPath(file: DiffFile): string {
|
|
21
|
+
if (file.fullPath) return file.fullPath
|
|
22
|
+
|
|
23
|
+
if (file.diffPair) {
|
|
24
|
+
return file.diffPair[1]?.filename || file.diffPair[0]?.filename
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (typeof file.diffPatch === 'string') {
|
|
28
|
+
return parsePatchFilenames(file.diffPatch).modFilename
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return ''
|
|
32
|
+
}
|
|
33
|
+
const files = diffFiles.map<FileItem>((file, index) => {
|
|
34
|
+
const fullPath = resolveDiffFileFullPath(file)
|
|
35
|
+
|
|
36
|
+
const pathSegments = fullPath.split('/')
|
|
37
|
+
const name = pathSegments.at(-1) || ''
|
|
38
|
+
const extname = name.split('.').at(-1)
|
|
39
|
+
|
|
40
|
+
return {
|
|
41
|
+
...file,
|
|
42
|
+
fullPath,
|
|
43
|
+
name,
|
|
44
|
+
folderPath: pathSegments.slice(0, -1).join('/'),
|
|
45
|
+
type: extname?.toLowerCase(),
|
|
46
|
+
}
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
files.sort((left, right) => {
|
|
50
|
+
if (left.fullPath === right.fullPath) return 0
|
|
51
|
+
return left.fullPath > right.fullPath ? 1 : -1
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
const fileMap: Record<string, FileItem> = Object.fromEntries(files.map(file => [file.fullPath, file]))
|
|
55
|
+
return { files, fileMap }
|
|
56
|
+
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="diff-viewer-wrap" :style="viewerStyle">
|
|
3
|
-
<TopBar class="top-bar" :diffPair="diffPair" />
|
|
2
|
+
<div class="diff-viewer-wrap" :style="viewerStyle" @viewStateChange="">
|
|
3
|
+
<TopBar class="top-bar" :diffPair="diffPair" :diffPatch="diffPatch" />
|
|
4
4
|
<div class="content-wrap" v-show="!viewed" v-loading="loading">
|
|
5
5
|
<MonacoDiffViewer
|
|
6
6
|
class="monaco-container"
|
|
7
|
+
:style="{ opacity: loading ? 0 : 1 }"
|
|
7
8
|
:originalCode="originalCode"
|
|
8
9
|
:modifiedCode="modifiedCode"
|
|
9
10
|
:language="language"
|
|
@@ -16,27 +17,34 @@
|
|
|
16
17
|
</template>
|
|
17
18
|
|
|
18
19
|
<script setup lang="ts">
|
|
19
|
-
import { ref, computed } from 'vue'
|
|
20
|
+
import { ref, computed, nextTick } from 'vue'
|
|
20
21
|
|
|
21
22
|
import { loadingDirective } from '@yuhufe/web-ui'
|
|
23
|
+
import { v4 } from '@yuhufe/web-common'
|
|
22
24
|
import type { DiffEditorOptions, WtoolDiffViewerProps, ModelOptions } from '../types'
|
|
23
25
|
import MonacoDiffViewer from './MonacoDiffViewer.vue'
|
|
24
26
|
import TopBar from './TopBar.vue'
|
|
25
27
|
import { useDiffViewer } from './useDiffView'
|
|
26
28
|
import { patch2Pair } from './utils/patch2Pair'
|
|
27
29
|
import { autoHeight } from './utils/autoHeight'
|
|
30
|
+
import { HEIGHT_TOP_BAR } from './const'
|
|
31
|
+
|
|
32
|
+
const emit = defineEmits<{
|
|
33
|
+
viewStateChange: [data: { viewed: boolean; rawed: boolean }]
|
|
34
|
+
}>()
|
|
28
35
|
|
|
29
36
|
const vLoading = loadingDirective
|
|
30
37
|
const loading = ref(true)
|
|
31
38
|
|
|
32
39
|
const _renderStart = performance.now()
|
|
33
|
-
const onMonacoRenderComplete = () => {
|
|
40
|
+
const onMonacoRenderComplete = async () => {
|
|
34
41
|
const cost = performance.now() - _renderStart
|
|
35
42
|
console.log(`[DiffViewer] 渲染耗时: ${cost.toFixed(2)} ms`)
|
|
36
43
|
loading.value = false
|
|
37
44
|
}
|
|
38
45
|
|
|
39
46
|
const props = withDefaults(defineProps<WtoolDiffViewerProps>(), {
|
|
47
|
+
fileId: '',
|
|
40
48
|
diffPair: () => [],
|
|
41
49
|
diffPatch: '',
|
|
42
50
|
language: 'plaintext',
|
|
@@ -77,6 +85,7 @@ const mergedOptions = computed(() => {
|
|
|
77
85
|
hideUnchangedRegions = {
|
|
78
86
|
enabled: true,
|
|
79
87
|
contextLineCount: 3,
|
|
88
|
+
minimumLineCount: 1,
|
|
80
89
|
...hideUnchangedRegions,
|
|
81
90
|
}
|
|
82
91
|
}
|
|
@@ -87,8 +96,8 @@ const mergedOptions = computed(() => {
|
|
|
87
96
|
}
|
|
88
97
|
})
|
|
89
98
|
|
|
90
|
-
const viewed = ref<boolean>(false) // 是否已读
|
|
91
|
-
const rawed = ref<boolean>(false) // 是否显示原始文件
|
|
99
|
+
const viewed = ref<boolean>(props.viewerStyle?.viewed ?? false) // 是否已读
|
|
100
|
+
const rawed = ref<boolean>(props.viewerStyle?.rawed ?? false) // 是否显示原始文件
|
|
92
101
|
const canUnchangeVisible = ref(!props.diffPatch) // patch 模式下未改动区域为空行,不可展示
|
|
93
102
|
|
|
94
103
|
// 编辑器样式
|
|
@@ -103,14 +112,18 @@ const viewerHeight = computed(() => {
|
|
|
103
112
|
...(props.viewerStyle || {}),
|
|
104
113
|
}
|
|
105
114
|
|
|
115
|
+
const autoHeightId = props.fileId || v4()
|
|
106
116
|
const height = autoHeight({
|
|
117
|
+
id: autoHeightId,
|
|
107
118
|
patch: props.diffPatch,
|
|
108
119
|
pair: props.diffPair,
|
|
109
120
|
...heightRange,
|
|
110
121
|
unchangedVisiable: funcs.rawed.value,
|
|
111
|
-
unchangedCtxLineNum: mergedOptions.value.hideUnchangedRegions.contextLineCount
|
|
122
|
+
unchangedCtxLineNum: mergedOptions.value.hideUnchangedRegions.contextLineCount ?? 3,
|
|
123
|
+
unchangedMinLineNum: mergedOptions.value.hideUnchangedRegions.minimumLineCount ?? 1,
|
|
112
124
|
})
|
|
113
125
|
|
|
126
|
+
// 当前高度为代码高度
|
|
114
127
|
return `${height}px`
|
|
115
128
|
})
|
|
116
129
|
const viewerStyle = computed(() => {
|
|
@@ -122,7 +135,15 @@ const viewerStyle = computed(() => {
|
|
|
122
135
|
|
|
123
136
|
registerFunc({
|
|
124
137
|
viewed,
|
|
138
|
+
updateViewed(newVal) {
|
|
139
|
+
viewed.value = newVal
|
|
140
|
+
emit('viewStateChange', { rawed: rawed.value, viewed: newVal })
|
|
141
|
+
},
|
|
125
142
|
rawed,
|
|
143
|
+
updateRawed(newVal) {
|
|
144
|
+
rawed.value = newVal
|
|
145
|
+
emit('viewStateChange', { rawed: newVal, viewed: viewed.value })
|
|
146
|
+
},
|
|
126
147
|
canUnchangeVisible,
|
|
127
148
|
})
|
|
128
149
|
</script>
|
|
@@ -7,6 +7,7 @@ import { ref, watch, onMounted, onBeforeUnmount, shallowRef } from 'vue'
|
|
|
7
7
|
import loader from '@monaco-editor/loader'
|
|
8
8
|
import type * as Monaco from 'monaco-editor'
|
|
9
9
|
import { useDiffViewer } from './useDiffView'
|
|
10
|
+
import { HEIGHT_CODE_LINE, HEIGHT_HORIZONTAL_SCROLLBAR } from './const'
|
|
10
11
|
|
|
11
12
|
type DiffEditorOptions = Monaco.editor.IStandaloneDiffEditorConstructionOptions
|
|
12
13
|
type ModelOptions = Monaco.editor.ITextModelUpdateOptions
|
|
@@ -58,15 +59,18 @@ onMounted(() => {
|
|
|
58
59
|
renderSideBySide: true,
|
|
59
60
|
useInlineViewWhenSpaceIsLimited: false,
|
|
60
61
|
scrollBeyondLastLine: false,
|
|
62
|
+
lineHeight: HEIGHT_CODE_LINE,
|
|
61
63
|
hideUnchangedRegions: {
|
|
62
64
|
enabled: true,
|
|
63
65
|
contextLineCount: 3,
|
|
64
66
|
},
|
|
67
|
+
...props.options,
|
|
65
68
|
scrollbar: {
|
|
66
69
|
verticalScrollbarSize: 8,
|
|
67
|
-
horizontalScrollbarSize:
|
|
70
|
+
horizontalScrollbarSize: HEIGHT_HORIZONTAL_SCROLLBAR,
|
|
71
|
+
alwaysConsumeMouseWheel: false,
|
|
72
|
+
...props.options.scrollbar,
|
|
68
73
|
},
|
|
69
|
-
...props.options,
|
|
70
74
|
})
|
|
71
75
|
editor.value.setModel({
|
|
72
76
|
original: originalModel.value,
|
|
@@ -165,6 +169,21 @@ watch(
|
|
|
165
169
|
</style>
|
|
166
170
|
|
|
167
171
|
<style>
|
|
172
|
+
/* Monaco tooltip 会挂载到独立的 context view 中,需使用非 scoped 样式避免遮挡工具按钮 */
|
|
173
|
+
.context-view.monaco-component {
|
|
174
|
+
.workbench-hover-container {
|
|
175
|
+
.hover-contents {
|
|
176
|
+
white-space: nowrap !important;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.monaco-editor-container {
|
|
182
|
+
.codicon.codicon-widget-close {
|
|
183
|
+
box-sizing: content-box !important;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
168
187
|
/* patch 模式:未改动区域为空行,隐藏 monaco 内置的展开未改动区域按钮(非 scoped,配合 JS class 控制) */
|
|
169
188
|
.monaco-editor-container.hide-unchanged-actions {
|
|
170
189
|
.diff-hidden-lines-widget {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="top-bar-wrap">
|
|
2
|
+
<div class="top-bar-wrap" :style="{ height: `${HEIGHT_TOP_BAR}px` }">
|
|
3
3
|
<div class="title-area">
|
|
4
4
|
<div class="filename">{{ filenameDisplay }}</div>
|
|
5
5
|
<span :class="['diff-type-tag', diffType]">{{ diffTypeLabel }}</span>
|
|
6
6
|
<div class="diff-line-num">
|
|
7
|
-
<div class="add" v-if="diffType !== 'del'">+{{
|
|
8
|
-
<div class="del" v-if="diffType !== 'add'">-{{
|
|
7
|
+
<div class="add" v-if="diffType !== 'del'">+{{ displayedChanged.added }}</div>
|
|
8
|
+
<div class="del" v-if="diffType !== 'add'">-{{ displayedChanged.removed }}</div>
|
|
9
9
|
</div>
|
|
10
10
|
</div>
|
|
11
11
|
<div class="toolbar">
|
|
@@ -24,15 +24,19 @@
|
|
|
24
24
|
<script setup lang="ts">
|
|
25
25
|
import { computed, ref, onMounted } from 'vue'
|
|
26
26
|
import { useDiffViewer } from './useDiffView'
|
|
27
|
+
import { HEIGHT_TOP_BAR } from './const'
|
|
28
|
+
import { parsePatchHunks } from '@/utils/patch'
|
|
27
29
|
|
|
28
30
|
const { funcs, registerFunc } = useDiffViewer()
|
|
29
31
|
|
|
30
32
|
const props = withDefaults(
|
|
31
33
|
defineProps<{
|
|
32
34
|
diffPair?: { filename: string; content: string | null }[]
|
|
35
|
+
diffPatch?: string
|
|
33
36
|
}>(),
|
|
34
37
|
{
|
|
35
38
|
diffPair: () => [],
|
|
39
|
+
diffPatch: '',
|
|
36
40
|
}
|
|
37
41
|
)
|
|
38
42
|
|
|
@@ -73,11 +77,11 @@ const filenameDisplay = computed(() => {
|
|
|
73
77
|
const { viewed, rawed, canUnchangeVisible } = funcs
|
|
74
78
|
const onViewedChange = function (evt) {
|
|
75
79
|
const checked = (evt.target as HTMLInputElement).checked
|
|
76
|
-
|
|
80
|
+
funcs.updateViewed(checked)
|
|
77
81
|
}
|
|
78
82
|
const onRawedChange = function (evt) {
|
|
79
83
|
const checked = (evt.target as HTMLInputElement).checked
|
|
80
|
-
|
|
84
|
+
funcs.updateRawed(checked)
|
|
81
85
|
}
|
|
82
86
|
|
|
83
87
|
onMounted(() => {
|
|
@@ -86,6 +90,22 @@ onMounted(() => {
|
|
|
86
90
|
|
|
87
91
|
// 变更行数
|
|
88
92
|
const changed = ref({ added: 0, removed: 0 })
|
|
93
|
+
const patchChanged = computed(() => {
|
|
94
|
+
const result = { added: 0, removed: 0 }
|
|
95
|
+
|
|
96
|
+
for (const hunk of parsePatchHunks(props.diffPatch)) {
|
|
97
|
+
for (const line of hunk.lines) {
|
|
98
|
+
if (line.startsWith('+')) {
|
|
99
|
+
result.added++
|
|
100
|
+
} else if (line.startsWith('-')) {
|
|
101
|
+
result.removed++
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return result
|
|
107
|
+
})
|
|
108
|
+
const displayedChanged = computed(() => (props.diffPatch ? patchChanged.value : changed.value))
|
|
89
109
|
function updateChangedLines(newVal) {
|
|
90
110
|
Object.assign(changed.value, newVal)
|
|
91
111
|
}
|
|
@@ -100,7 +120,6 @@ registerFunc({
|
|
|
100
120
|
<style scoped>
|
|
101
121
|
.top-bar-wrap {
|
|
102
122
|
box-sizing: border-box;
|
|
103
|
-
height: 32px;
|
|
104
123
|
|
|
105
124
|
display: flex;
|
|
106
125
|
overflow: hidden;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** 顶部工具栏的固定高度,单位:像素。 */
|
|
2
|
+
export const HEIGHT_TOP_BAR = 32
|
|
3
|
+
|
|
4
|
+
/** Diff 编辑器中单行代码的默认高度,单位:像素。 */
|
|
5
|
+
export const HEIGHT_CODE_LINE = 18
|
|
6
|
+
|
|
7
|
+
/** 未变更代码折叠区域占用的固定高度,单位:像素。 */
|
|
8
|
+
export const HEIGHT_HIDDEN_REGION = 24
|
|
9
|
+
|
|
10
|
+
/** Diff 编辑器横向滚动条的默认高度,单位:像素。 */
|
|
11
|
+
export const HEIGHT_HORIZONTAL_SCROLLBAR = 8
|