@yuhufe/wtool-vdiff 0.0.1 → 0.0.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/dist/DiffViewer/DiffViewer.vue.d.ts +1 -1
- package/dist/DiffViewer/TopBar.vue.d.ts +2 -2
- package/dist/DiffViewer/utils/patch2Pair.d.ts +6 -3
- package/dist/types.d.ts +1 -1
- package/dist/wtool-vdiff.cjs.js +34 -34
- package/dist/wtool-vdiff.css +1 -1
- package/dist/wtool-vdiff.es.js +2805 -2777
- package/package.json +3 -2
- package/src/DiffViewer/DiffViewer.vue +2 -2
- package/src/DiffViewer/TopBar.vue +72 -6
- package/src/DiffViewer/utils/autoHeight.ts +2 -2
- package/src/DiffViewer/utils/patch2Pair.ts +25 -14
- package/src/types.ts +1 -1
|
@@ -5,7 +5,7 @@ declare const _default: import('../../node_modules/vue/dist/vue.esm-bundler.js')
|
|
|
5
5
|
modelOptions: ModelOptions;
|
|
6
6
|
diffPair: {
|
|
7
7
|
filename: string;
|
|
8
|
-
content: string;
|
|
8
|
+
content: string | null;
|
|
9
9
|
}[];
|
|
10
10
|
diffPatch: string;
|
|
11
11
|
}, {}, {}, {}, string, import('../../node_modules/vue/dist/vue.esm-bundler.js').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
type __VLS_Props = {
|
|
2
2
|
diffPair?: {
|
|
3
3
|
filename: string;
|
|
4
|
-
content: string;
|
|
4
|
+
content: string | null;
|
|
5
5
|
}[];
|
|
6
6
|
};
|
|
7
7
|
declare const _default: import('../../node_modules/vue/dist/vue.esm-bundler.js').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('../../node_modules/vue/dist/vue.esm-bundler.js').ComponentOptionsMixin, import('../../node_modules/vue/dist/vue.esm-bundler.js').ComponentOptionsMixin, {}, string, import('../../node_modules/vue/dist/vue.esm-bundler.js').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
8
8
|
diffPair: {
|
|
9
9
|
filename: string;
|
|
10
|
-
content: string;
|
|
10
|
+
content: string | null;
|
|
11
11
|
}[];
|
|
12
12
|
}, {}, {}, {}, string, import('../../node_modules/vue/dist/vue.esm-bundler.js').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
13
13
|
export default _default;
|
|
@@ -20,8 +20,11 @@ export declare function parseHunks(patch: string): {
|
|
|
20
20
|
/**
|
|
21
21
|
* 将 unified diff patch 转换为 [original, modified] 文件对。
|
|
22
22
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
23
|
+
* 策略:
|
|
24
|
+
* - hunk 之外的行(patch 未提供内容):两侧各补一个空行撑开行号,
|
|
25
|
+
* Monaco hideUnchangedRegions 会将这些相同的空行折叠并显示正确的行号范围
|
|
26
|
+
* - context 行(' '):两侧均写入真实内容
|
|
27
|
+
* - 连续的删除('-')/ 新增('+')块:收集后成对对齐写入,
|
|
28
|
+
* 行数较少的一侧补空行,使 Monaco 能在同一视觉行渲染替换关系
|
|
26
29
|
*/
|
|
27
30
|
export declare const patch2Pair: (patch: string) => FilePair[];
|
package/dist/types.d.ts
CHANGED