@git-diff-view/react 0.1.3 → 0.1.4
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/cjs/index.development.js +497 -503
- package/dist/cjs/index.development.js.map +1 -1
- package/dist/cjs/index.production.js +497 -503
- package/dist/cjs/index.production.js.map +1 -1
- package/dist/css/diff-view-pure.css +111 -0
- package/dist/css/diff-view.css +111 -0
- package/dist/esm/index.mjs +499 -506
- package/dist/esm/index.mjs.map +1 -1
- package/index.d.ts +236 -7
- package/package.json +2 -2
- package/src/_com.css +99 -0
- package/src/components/DiffAddWidget.tsx +4 -3
- package/src/components/DiffContent.tsx +6 -6
- package/src/components/DiffExpand.tsx +0 -2
- package/src/components/DiffNoNewLine.tsx +0 -2
- package/src/components/DiffSplitContentLineNormal.tsx +3 -4
- package/src/components/DiffSplitContentLineWrap.tsx +9 -10
- package/src/components/DiffSplitExtendLineNormal.tsx +3 -3
- package/src/components/DiffSplitExtendLineWrap.tsx +4 -4
- package/src/components/DiffSplitHunkLineNormal.tsx +0 -1
- package/src/components/DiffSplitHunkLineWrap.tsx +0 -1
- package/src/components/DiffSplitView.tsx +0 -1
- package/src/components/DiffSplitViewNormal.tsx +13 -12
- package/src/components/DiffSplitViewWrap.tsx +10 -10
- package/src/components/DiffSplitWidgetLineNormal.tsx +2 -2
- package/src/components/DiffSplitWidgetLineWrap.tsx +12 -2
- package/src/components/DiffUnifiedContentLine.tsx +1 -2
- package/src/components/DiffUnifiedExtendLine.tsx +4 -5
- package/src/components/DiffUnifiedHunkLine.tsx +0 -1
- package/src/components/DiffUnifiedView.tsx +9 -9
- package/src/components/DiffUnifiedWidgetLine.tsx +2 -2
- package/src/components/DiffView.tsx +26 -20
- package/src/components/DiffViewContext.ts +2 -0
- package/src/components/DiffViewWithMultiSelect.tsx +321 -0
- package/src/components/DiffWidgetContext.ts +4 -2
- package/src/components/tools.ts +6 -5
- package/src/components/v2/DiffSplitContentLineNormal_v2.tsx +4 -5
- package/src/components/v2/DiffSplitContentLineWrap_v2.tsx +11 -12
- package/src/components/v2/DiffSplitExtendLineNormal_v2.tsx +3 -3
- package/src/components/v2/DiffSplitExtendLineWrap_v2.tsx +4 -4
- package/src/components/v2/DiffSplitHunkLineNormal_v2.tsx +0 -1
- package/src/components/v2/DiffSplitHunkLineWrap_v2.tsx +0 -1
- package/src/components/v2/DiffSplitViewLineNormal_v2.tsx +0 -1
- package/src/components/v2/DiffSplitViewLineWrap_v2.tsx +0 -1
- package/src/components/v2/DiffSplitViewNormal_v2.tsx +9 -8
- package/src/components/v2/DiffSplitViewWrap_v2.tsx +5 -5
- package/src/components/v2/DiffSplitView_v2.tsx +0 -1
- package/src/components/v2/DiffSplitWidgetLineNormal_v2.tsx +2 -3
- package/src/components/v2/DiffSplitWidgetLineWrap_v2.tsx +4 -5
- package/src/hooks/useCallbackRef.ts +13 -0
- package/src/hooks/useDomWidth.ts +5 -5
- package/src/hooks/useIsMounted.ts +1 -0
- package/src/hooks/useSyncHeight.ts +3 -3
- package/src/hooks/useTextWidth.ts +1 -1
- package/src/hooks/useUnmount.ts +1 -0
- package/src/hooks/useUpdateEffect.ts +15 -0
- package/src/index.ts +1 -2
- package/styles/diff-view-pure.css +111 -0
- package/styles/diff-view.css +111 -0
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { emptyBGName } from "@git-diff-view/utils";
|
|
2
|
-
import * as React from "react";
|
|
3
2
|
|
|
4
3
|
import { useDomWidth } from "../../hooks/useDomWidth";
|
|
5
4
|
import { useSyncHeight } from "../../hooks/useSyncHeight";
|
|
@@ -52,7 +51,7 @@ const InternalDiffSplitWidgetLine = ({
|
|
|
52
51
|
wrapper: `div[data-state="widget"][data-line="${lineNumber}-widget"]`,
|
|
53
52
|
selector: `div[data-line="${lineNumber}-widget-content"]`,
|
|
54
53
|
side: SplitSide[currentHasWidget ? side : otherSide],
|
|
55
|
-
enable: hasWidget && typeof renderWidgetLine === "function",
|
|
54
|
+
enable: !!hasWidget && typeof renderWidgetLine === "function",
|
|
56
55
|
});
|
|
57
56
|
|
|
58
57
|
const width = useDomWidth({
|
|
@@ -81,7 +80,7 @@ const InternalDiffSplitWidgetLine = ({
|
|
|
81
80
|
renderWidgetLine?.({
|
|
82
81
|
diffFile,
|
|
83
82
|
side,
|
|
84
|
-
lineNumber: currentLine.lineNumber,
|
|
83
|
+
lineNumber: currentLine.lineNumber ?? -1,
|
|
85
84
|
onClose: () => setWidget({}),
|
|
86
85
|
})}
|
|
87
86
|
</div>
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { borderColorName, emptyBGName } from "@git-diff-view/utils";
|
|
2
|
-
import * as React from "react";
|
|
3
2
|
|
|
4
3
|
import { SplitSide } from "../DiffView";
|
|
5
4
|
import { useDiffViewContext } from "../DiffViewContext";
|
|
@@ -39,7 +38,7 @@ const InternalDiffSplitWidgetLine = ({
|
|
|
39
38
|
renderWidgetLine?.({
|
|
40
39
|
diffFile,
|
|
41
40
|
side: SplitSide.old,
|
|
42
|
-
lineNumber: oldLine.lineNumber,
|
|
41
|
+
lineNumber: oldLine.lineNumber ?? -1,
|
|
43
42
|
onClose: () => setWidget({}),
|
|
44
43
|
});
|
|
45
44
|
|
|
@@ -48,7 +47,7 @@ const InternalDiffSplitWidgetLine = ({
|
|
|
48
47
|
renderWidgetLine?.({
|
|
49
48
|
diffFile,
|
|
50
49
|
side: SplitSide.new,
|
|
51
|
-
lineNumber: newLine.lineNumber,
|
|
50
|
+
lineNumber: newLine.lineNumber ?? -1,
|
|
52
51
|
onClose: () => setWidget({}),
|
|
53
52
|
});
|
|
54
53
|
|
|
@@ -112,8 +111,8 @@ export const DiffSplitWidgetLine = ({
|
|
|
112
111
|
index={index}
|
|
113
112
|
diffFile={diffFile}
|
|
114
113
|
lineNumber={lineNumber}
|
|
115
|
-
oldLineWidget={oldLineWidget}
|
|
116
|
-
newLineWidget={newLineWidget}
|
|
114
|
+
oldLineWidget={!!oldLineWidget}
|
|
115
|
+
newLineWidget={!!newLineWidget}
|
|
117
116
|
/>
|
|
118
117
|
);
|
|
119
118
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-unsafe-function-type */
|
|
2
|
+
import { useCallback, useRef } from "react";
|
|
3
|
+
|
|
4
|
+
export const useCallbackRef = <T extends Function>(cb?: T) => {
|
|
5
|
+
const cbRef = useRef(cb);
|
|
6
|
+
|
|
7
|
+
// eslint-disable-next-line react-hooks/refs
|
|
8
|
+
cbRef.current = cb;
|
|
9
|
+
|
|
10
|
+
return useCallback((...args: any[]) => {
|
|
11
|
+
return cbRef.current?.(...args);
|
|
12
|
+
}, []) as unknown as T;
|
|
13
|
+
};
|
package/src/hooks/useDomWidth.ts
CHANGED
|
@@ -4,8 +4,8 @@ import { useEffect, useState } from "react";
|
|
|
4
4
|
import { useDiffViewContext } from "../components/DiffViewContext";
|
|
5
5
|
|
|
6
6
|
export type ObserveElement = HTMLElement & {
|
|
7
|
-
__observeCallback
|
|
8
|
-
__observeInstance
|
|
7
|
+
__observeCallback?: Set<() => void>;
|
|
8
|
+
__observeInstance?: ResizeObserver;
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export const useDomWidth = ({ selector, enable }: { selector: string; enable: boolean }) => {
|
|
@@ -39,8 +39,8 @@ export const useDomWidth = ({ selector, enable }: { selector: string; enable: bo
|
|
|
39
39
|
cb();
|
|
40
40
|
|
|
41
41
|
const cleanCb = () => {
|
|
42
|
-
typedWrapper
|
|
43
|
-
if (typedWrapper
|
|
42
|
+
typedWrapper?.__observeCallback?.delete(cb);
|
|
43
|
+
if (typedWrapper?.__observeCallback?.size === 0) {
|
|
44
44
|
typedWrapper.__observeInstance?.disconnect();
|
|
45
45
|
typedWrapper.removeAttribute("data-observe");
|
|
46
46
|
delete typedWrapper.__observeCallback;
|
|
@@ -58,7 +58,7 @@ export const useDomWidth = ({ selector, enable }: { selector: string; enable: bo
|
|
|
58
58
|
|
|
59
59
|
typedWrapper.__observeCallback.add(cb);
|
|
60
60
|
|
|
61
|
-
const observer = new ResizeObserver(() => typedWrapper
|
|
61
|
+
const observer = new ResizeObserver(() => typedWrapper?.__observeCallback?.forEach((cb) => cb()));
|
|
62
62
|
|
|
63
63
|
typedWrapper.__observeInstance = observer;
|
|
64
64
|
|
|
@@ -60,8 +60,8 @@ export const useSyncHeight = ({
|
|
|
60
60
|
cb();
|
|
61
61
|
|
|
62
62
|
const cleanCb = () => {
|
|
63
|
-
typedTarget
|
|
64
|
-
if (typedTarget
|
|
63
|
+
typedTarget?.__observeCallback?.delete(cb);
|
|
64
|
+
if (typedTarget?.__observeCallback?.size === 0) {
|
|
65
65
|
typedTarget.__observeInstance?.disconnect();
|
|
66
66
|
typedTarget.removeAttribute("data-observe");
|
|
67
67
|
delete typedTarget.__observeCallback;
|
|
@@ -79,7 +79,7 @@ export const useSyncHeight = ({
|
|
|
79
79
|
|
|
80
80
|
typedTarget.__observeCallback.add(cb);
|
|
81
81
|
|
|
82
|
-
const observer = new ResizeObserver(() => typedTarget
|
|
82
|
+
const observer = new ResizeObserver(() => typedTarget?.__observeCallback?.forEach((cb) => cb()));
|
|
83
83
|
|
|
84
84
|
typedTarget.__observeInstance = observer;
|
|
85
85
|
|
|
@@ -11,7 +11,7 @@ export const useTextWidth = ({
|
|
|
11
11
|
font: { fontFamily?: string; fontStyle?: string; fontSize?: string };
|
|
12
12
|
}) => {
|
|
13
13
|
const [width, setWidth] = useState(() => {
|
|
14
|
-
const fontSize = parseInt(font.fontSize);
|
|
14
|
+
const fontSize = parseInt(font.fontSize || "13");
|
|
15
15
|
let baseSize = 6;
|
|
16
16
|
baseSize += fontSize > 10 ? (fontSize - 10) * 0.6 : 0;
|
|
17
17
|
return baseSize * text.length;
|
package/src/hooks/useUnmount.ts
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useEffect, useRef } from "react";
|
|
2
|
+
|
|
3
|
+
import type { DependencyList, EffectCallback } from "react";
|
|
4
|
+
|
|
5
|
+
export const useUpdateEffect = (effect: EffectCallback, deps: DependencyList) => {
|
|
6
|
+
const isMounted = useRef(false);
|
|
7
|
+
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
if (isMounted.current) {
|
|
10
|
+
return effect();
|
|
11
|
+
}
|
|
12
|
+
isMounted.current = true;
|
|
13
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
14
|
+
}, deps);
|
|
15
|
+
};
|
package/src/index.ts
CHANGED
|
@@ -1,27 +1,45 @@
|
|
|
1
|
+
.diff-tailwindcss-wrapper .\!container {
|
|
2
|
+
width: 100% !important;
|
|
3
|
+
}
|
|
1
4
|
.diff-tailwindcss-wrapper .container {
|
|
2
5
|
width: 100%;
|
|
3
6
|
}
|
|
4
7
|
@media (min-width: 640px) {
|
|
8
|
+
.diff-tailwindcss-wrapper .\!container {
|
|
9
|
+
max-width: 640px !important;
|
|
10
|
+
}
|
|
5
11
|
.diff-tailwindcss-wrapper .container {
|
|
6
12
|
max-width: 640px;
|
|
7
13
|
}
|
|
8
14
|
}
|
|
9
15
|
@media (min-width: 768px) {
|
|
16
|
+
.diff-tailwindcss-wrapper .\!container {
|
|
17
|
+
max-width: 768px !important;
|
|
18
|
+
}
|
|
10
19
|
.diff-tailwindcss-wrapper .container {
|
|
11
20
|
max-width: 768px;
|
|
12
21
|
}
|
|
13
22
|
}
|
|
14
23
|
@media (min-width: 1024px) {
|
|
24
|
+
.diff-tailwindcss-wrapper .\!container {
|
|
25
|
+
max-width: 1024px !important;
|
|
26
|
+
}
|
|
15
27
|
.diff-tailwindcss-wrapper .container {
|
|
16
28
|
max-width: 1024px;
|
|
17
29
|
}
|
|
18
30
|
}
|
|
19
31
|
@media (min-width: 1280px) {
|
|
32
|
+
.diff-tailwindcss-wrapper .\!container {
|
|
33
|
+
max-width: 1280px !important;
|
|
34
|
+
}
|
|
20
35
|
.diff-tailwindcss-wrapper .container {
|
|
21
36
|
max-width: 1280px;
|
|
22
37
|
}
|
|
23
38
|
}
|
|
24
39
|
@media (min-width: 1536px) {
|
|
40
|
+
.diff-tailwindcss-wrapper .\!container {
|
|
41
|
+
max-width: 1536px !important;
|
|
42
|
+
}
|
|
25
43
|
.diff-tailwindcss-wrapper .container {
|
|
26
44
|
max-width: 1536px;
|
|
27
45
|
}
|
|
@@ -408,12 +426,105 @@
|
|
|
408
426
|
.diff-tailwindcss-wrapper .diff-widget-tooltip:hover::after {
|
|
409
427
|
display: block;
|
|
410
428
|
}
|
|
429
|
+
.diff-line-extend-wrapper,
|
|
430
|
+
.diff-line-widget-wrapper {
|
|
431
|
+
display: flow-root;
|
|
432
|
+
}
|
|
411
433
|
.diff-line-extend-wrapper * {
|
|
412
434
|
color: initial;
|
|
413
435
|
}
|
|
414
436
|
.diff-line-widget-wrapper * {
|
|
415
437
|
color: initial;
|
|
416
438
|
}
|
|
439
|
+
/* Multi-select styles for line range selection */
|
|
440
|
+
.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-new-num,
|
|
441
|
+
.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-old-num,
|
|
442
|
+
.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-num {
|
|
443
|
+
z-index: 2;
|
|
444
|
+
}
|
|
445
|
+
.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-content,
|
|
446
|
+
.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-new-content,
|
|
447
|
+
.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-old-content {
|
|
448
|
+
position: relative;
|
|
449
|
+
}
|
|
450
|
+
.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-new-num::after,
|
|
451
|
+
.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-old-num::after,
|
|
452
|
+
.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-num::after {
|
|
453
|
+
content: "";
|
|
454
|
+
position: absolute;
|
|
455
|
+
z-index: 1;
|
|
456
|
+
inset: 0;
|
|
457
|
+
opacity: 0.15;
|
|
458
|
+
background-color: var(--diff-multi-select-bg, #f0c000);
|
|
459
|
+
pointer-events: none;
|
|
460
|
+
}
|
|
461
|
+
.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-new-num::before,
|
|
462
|
+
.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-old-num::before,
|
|
463
|
+
.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-num::before {
|
|
464
|
+
content: "";
|
|
465
|
+
z-index: 2;
|
|
466
|
+
position: absolute;
|
|
467
|
+
top: 0;
|
|
468
|
+
bottom: 0;
|
|
469
|
+
right: -2px;
|
|
470
|
+
width: 4px;
|
|
471
|
+
background-color: var(--diff-multi-select-border, #2588fa);
|
|
472
|
+
}
|
|
473
|
+
.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-new-content::after,
|
|
474
|
+
.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-old-content::after,
|
|
475
|
+
.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-content::after {
|
|
476
|
+
content: "";
|
|
477
|
+
position: absolute;
|
|
478
|
+
z-index: 1;
|
|
479
|
+
inset: 0;
|
|
480
|
+
opacity: 0.15;
|
|
481
|
+
background-color: var(--diff-multi-select-bg, #f0c000);
|
|
482
|
+
pointer-events: none;
|
|
483
|
+
}
|
|
484
|
+
/* Multi-select: ensure proper positioning for line number cells */
|
|
485
|
+
.diff-multi-selecting .diff-line-old-num,
|
|
486
|
+
.diff-multi-selecting .diff-line-new-num,
|
|
487
|
+
.diff-multi-selecting .diff-line-num {
|
|
488
|
+
-webkit-user-select: none;
|
|
489
|
+
-moz-user-select: none;
|
|
490
|
+
user-select: none;
|
|
491
|
+
}
|
|
492
|
+
.diff-multi-selecting .diff-line-old-content,
|
|
493
|
+
.diff-multi-selecting .diff-line-new-content,
|
|
494
|
+
.diff-multi-selecting .diff-line-content {
|
|
495
|
+
-webkit-user-select: none;
|
|
496
|
+
-moz-user-select: none;
|
|
497
|
+
user-select: none;
|
|
498
|
+
}
|
|
499
|
+
/* Prevent text selection during multi-line selection */
|
|
500
|
+
.diff-multi-selecting {
|
|
501
|
+
-webkit-user-select: none;
|
|
502
|
+
-moz-user-select: none;
|
|
503
|
+
user-select: none;
|
|
504
|
+
}
|
|
505
|
+
.diff-multi-selecting * {
|
|
506
|
+
-webkit-user-select: none;
|
|
507
|
+
-moz-user-select: none;
|
|
508
|
+
user-select: none;
|
|
509
|
+
}
|
|
510
|
+
/* Hide addWidget button during active dragging selection */
|
|
511
|
+
.diff-multi-selecting .diff-add-widget-wrapper {
|
|
512
|
+
display: none;
|
|
513
|
+
}
|
|
514
|
+
/* Ensure addWidget button is above selection overlay */
|
|
515
|
+
.diff-multiselect-wrapper .diff-add-widget-wrapper {
|
|
516
|
+
z-index: 10 !important;
|
|
517
|
+
}
|
|
518
|
+
/* Line number span should not interfere with click events */
|
|
519
|
+
.diff-tailwindcss-wrapper .diff-line-new-num span[data-line-num],
|
|
520
|
+
.diff-tailwindcss-wrapper .diff-line-old-num span[data-line-num] {
|
|
521
|
+
pointer-events: none;
|
|
522
|
+
}
|
|
523
|
+
.diff-multiselect-wrapper .diff-line-old-num,
|
|
524
|
+
.diff-multiselect-wrapper .diff-line-new-num,
|
|
525
|
+
.diff-multiselect-wrapper .diff-line-num {
|
|
526
|
+
cursor: pointer;
|
|
527
|
+
}
|
|
417
528
|
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw pre code.hljs {
|
|
418
529
|
display: block;
|
|
419
530
|
overflow-x: auto;
|
package/styles/diff-view.css
CHANGED
|
@@ -1,27 +1,45 @@
|
|
|
1
|
+
.diff-tailwindcss-wrapper .\!container {
|
|
2
|
+
width: 100% !important;
|
|
3
|
+
}
|
|
1
4
|
.diff-tailwindcss-wrapper .container {
|
|
2
5
|
width: 100%;
|
|
3
6
|
}
|
|
4
7
|
@media (min-width: 640px) {
|
|
8
|
+
.diff-tailwindcss-wrapper .\!container {
|
|
9
|
+
max-width: 640px !important;
|
|
10
|
+
}
|
|
5
11
|
.diff-tailwindcss-wrapper .container {
|
|
6
12
|
max-width: 640px;
|
|
7
13
|
}
|
|
8
14
|
}
|
|
9
15
|
@media (min-width: 768px) {
|
|
16
|
+
.diff-tailwindcss-wrapper .\!container {
|
|
17
|
+
max-width: 768px !important;
|
|
18
|
+
}
|
|
10
19
|
.diff-tailwindcss-wrapper .container {
|
|
11
20
|
max-width: 768px;
|
|
12
21
|
}
|
|
13
22
|
}
|
|
14
23
|
@media (min-width: 1024px) {
|
|
24
|
+
.diff-tailwindcss-wrapper .\!container {
|
|
25
|
+
max-width: 1024px !important;
|
|
26
|
+
}
|
|
15
27
|
.diff-tailwindcss-wrapper .container {
|
|
16
28
|
max-width: 1024px;
|
|
17
29
|
}
|
|
18
30
|
}
|
|
19
31
|
@media (min-width: 1280px) {
|
|
32
|
+
.diff-tailwindcss-wrapper .\!container {
|
|
33
|
+
max-width: 1280px !important;
|
|
34
|
+
}
|
|
20
35
|
.diff-tailwindcss-wrapper .container {
|
|
21
36
|
max-width: 1280px;
|
|
22
37
|
}
|
|
23
38
|
}
|
|
24
39
|
@media (min-width: 1536px) {
|
|
40
|
+
.diff-tailwindcss-wrapper .\!container {
|
|
41
|
+
max-width: 1536px !important;
|
|
42
|
+
}
|
|
25
43
|
.diff-tailwindcss-wrapper .container {
|
|
26
44
|
max-width: 1536px;
|
|
27
45
|
}
|
|
@@ -408,12 +426,105 @@
|
|
|
408
426
|
.diff-tailwindcss-wrapper .diff-widget-tooltip:hover::after {
|
|
409
427
|
display: block;
|
|
410
428
|
}
|
|
429
|
+
.diff-line-extend-wrapper,
|
|
430
|
+
.diff-line-widget-wrapper {
|
|
431
|
+
display: flow-root;
|
|
432
|
+
}
|
|
411
433
|
.diff-line-extend-wrapper * {
|
|
412
434
|
color: initial;
|
|
413
435
|
}
|
|
414
436
|
.diff-line-widget-wrapper * {
|
|
415
437
|
color: initial;
|
|
416
438
|
}
|
|
439
|
+
/* Multi-select styles for line range selection */
|
|
440
|
+
.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-new-num,
|
|
441
|
+
.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-old-num,
|
|
442
|
+
.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-num {
|
|
443
|
+
z-index: 2;
|
|
444
|
+
}
|
|
445
|
+
.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-content,
|
|
446
|
+
.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-new-content,
|
|
447
|
+
.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-old-content {
|
|
448
|
+
position: relative;
|
|
449
|
+
}
|
|
450
|
+
.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-new-num::after,
|
|
451
|
+
.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-old-num::after,
|
|
452
|
+
.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-num::after {
|
|
453
|
+
content: "";
|
|
454
|
+
position: absolute;
|
|
455
|
+
z-index: 1;
|
|
456
|
+
inset: 0;
|
|
457
|
+
opacity: 0.15;
|
|
458
|
+
background-color: var(--diff-multi-select-bg, #f0c000);
|
|
459
|
+
pointer-events: none;
|
|
460
|
+
}
|
|
461
|
+
.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-new-num::before,
|
|
462
|
+
.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-old-num::before,
|
|
463
|
+
.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-num::before {
|
|
464
|
+
content: "";
|
|
465
|
+
z-index: 2;
|
|
466
|
+
position: absolute;
|
|
467
|
+
top: 0;
|
|
468
|
+
bottom: 0;
|
|
469
|
+
right: -2px;
|
|
470
|
+
width: 4px;
|
|
471
|
+
background-color: var(--diff-multi-select-border, #2588fa);
|
|
472
|
+
}
|
|
473
|
+
.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-new-content::after,
|
|
474
|
+
.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-old-content::after,
|
|
475
|
+
.diff-tailwindcss-wrapper .diff-multi-select-active.diff-line-content::after {
|
|
476
|
+
content: "";
|
|
477
|
+
position: absolute;
|
|
478
|
+
z-index: 1;
|
|
479
|
+
inset: 0;
|
|
480
|
+
opacity: 0.15;
|
|
481
|
+
background-color: var(--diff-multi-select-bg, #f0c000);
|
|
482
|
+
pointer-events: none;
|
|
483
|
+
}
|
|
484
|
+
/* Multi-select: ensure proper positioning for line number cells */
|
|
485
|
+
.diff-multi-selecting .diff-line-old-num,
|
|
486
|
+
.diff-multi-selecting .diff-line-new-num,
|
|
487
|
+
.diff-multi-selecting .diff-line-num {
|
|
488
|
+
-webkit-user-select: none;
|
|
489
|
+
-moz-user-select: none;
|
|
490
|
+
user-select: none;
|
|
491
|
+
}
|
|
492
|
+
.diff-multi-selecting .diff-line-old-content,
|
|
493
|
+
.diff-multi-selecting .diff-line-new-content,
|
|
494
|
+
.diff-multi-selecting .diff-line-content {
|
|
495
|
+
-webkit-user-select: none;
|
|
496
|
+
-moz-user-select: none;
|
|
497
|
+
user-select: none;
|
|
498
|
+
}
|
|
499
|
+
/* Prevent text selection during multi-line selection */
|
|
500
|
+
.diff-multi-selecting {
|
|
501
|
+
-webkit-user-select: none;
|
|
502
|
+
-moz-user-select: none;
|
|
503
|
+
user-select: none;
|
|
504
|
+
}
|
|
505
|
+
.diff-multi-selecting * {
|
|
506
|
+
-webkit-user-select: none;
|
|
507
|
+
-moz-user-select: none;
|
|
508
|
+
user-select: none;
|
|
509
|
+
}
|
|
510
|
+
/* Hide addWidget button during active dragging selection */
|
|
511
|
+
.diff-multi-selecting .diff-add-widget-wrapper {
|
|
512
|
+
display: none;
|
|
513
|
+
}
|
|
514
|
+
/* Ensure addWidget button is above selection overlay */
|
|
515
|
+
.diff-multiselect-wrapper .diff-add-widget-wrapper {
|
|
516
|
+
z-index: 10 !important;
|
|
517
|
+
}
|
|
518
|
+
/* Line number span should not interfere with click events */
|
|
519
|
+
.diff-tailwindcss-wrapper .diff-line-new-num span[data-line-num],
|
|
520
|
+
.diff-tailwindcss-wrapper .diff-line-old-num span[data-line-num] {
|
|
521
|
+
pointer-events: none;
|
|
522
|
+
}
|
|
523
|
+
.diff-multiselect-wrapper .diff-line-old-num,
|
|
524
|
+
.diff-multiselect-wrapper .diff-line-new-num,
|
|
525
|
+
.diff-multiselect-wrapper .diff-line-num {
|
|
526
|
+
cursor: pointer;
|
|
527
|
+
}
|
|
417
528
|
.diff-tailwindcss-wrapper[data-theme="light"] .diff-line-syntax-raw pre code.hljs {
|
|
418
529
|
display: block;
|
|
419
530
|
overflow-x: auto;
|