stream-monaco 0.0.19 → 0.0.20
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 +163 -58
- package/README.zh-CN.md +135 -66
- package/dist/{index.base-9QTN8hPV.d.cts → index.base-Bt_RWV_F.d.ts} +93 -51
- package/dist/{index.base-D0lzInae.d.ts → index.base-DMJ2aLjO.d.cts} +93 -50
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/index.legacy.cjs +1 -1
- package/dist/index.legacy.d.cts +2 -2
- package/dist/index.legacy.d.ts +2 -2
- package/dist/index.legacy.js +1 -1
- package/dist/{preloadMonacoWorkers.shared-DMvZ1HUs.cjs → preloadMonacoWorkers.shared-B2kXtXTi.cjs} +2307 -276
- package/dist/{preloadMonacoWorkers.shared-DQ17-Bwz.js → preloadMonacoWorkers.shared-C-OxtyGI.js} +2331 -277
- package/package.json +12 -1
- package/dist/chunk-CHLpw0oG.js +0 -25
package/dist/{preloadMonacoWorkers.shared-DQ17-Bwz.js → preloadMonacoWorkers.shared-C-OxtyGI.js}
RENAMED
|
@@ -1,9 +1,32 @@
|
|
|
1
|
-
import { __export, __reExport } from "./chunk-CHLpw0oG.js";
|
|
2
1
|
import * as _monaco from "monaco-editor/esm/vs/editor/editor.api";
|
|
3
2
|
import { computed } from "alien-signals";
|
|
4
3
|
import { shikiToMonaco } from "@shikijs/monaco";
|
|
5
4
|
import { createHighlighter } from "shiki";
|
|
6
5
|
|
|
6
|
+
//#region rolldown:runtime
|
|
7
|
+
var __defProp = Object.defineProperty;
|
|
8
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
9
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
10
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
+
var __export = (target, all) => {
|
|
12
|
+
for (var name in all) __defProp(target, name, {
|
|
13
|
+
get: all[name],
|
|
14
|
+
enumerable: true
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
var __copyProps = (to, from, except, desc) => {
|
|
18
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
19
|
+
key = keys[i];
|
|
20
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
21
|
+
get: ((k) => from[k]).bind(null, key),
|
|
22
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
return to;
|
|
26
|
+
};
|
|
27
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
7
30
|
//#region src/code.detect.ts
|
|
8
31
|
/**
|
|
9
32
|
* Language detection definitions
|
|
@@ -448,9 +471,20 @@ function createScrollWatcherForEditor(ed, opts) {
|
|
|
448
471
|
//#region src/core/DiffEditorManager.ts
|
|
449
472
|
var DiffEditorManager = class DiffEditorManager {
|
|
450
473
|
static diffUiStyleId = "stream-monaco-diff-ui-style";
|
|
474
|
+
static diffLineStyleClasses = ["stream-monaco-diff-style-background", "stream-monaco-diff-style-bar"];
|
|
475
|
+
static diffUnchangedRegionStyleClasses = [
|
|
476
|
+
"stream-monaco-diff-unchanged-style-line-info",
|
|
477
|
+
"stream-monaco-diff-unchanged-style-line-info-basic",
|
|
478
|
+
"stream-monaco-diff-unchanged-style-metadata",
|
|
479
|
+
"stream-monaco-diff-unchanged-style-simple"
|
|
480
|
+
];
|
|
481
|
+
static diffLayoutModeClasses = ["stream-monaco-diff-inline", "stream-monaco-diff-side-by-side"];
|
|
482
|
+
static diffAppearanceClasses = ["stream-monaco-diff-appearance-light", "stream-monaco-diff-appearance-dark"];
|
|
451
483
|
diffEditorView = null;
|
|
452
484
|
originalModel = null;
|
|
453
485
|
modifiedModel = null;
|
|
486
|
+
originalModelOwned = false;
|
|
487
|
+
modifiedModelOwned = false;
|
|
454
488
|
lastContainer = null;
|
|
455
489
|
lastKnownOriginalCode = null;
|
|
456
490
|
lastKnownModifiedCode = null;
|
|
@@ -508,15 +542,35 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
508
542
|
diffHunkUpperNode = null;
|
|
509
543
|
diffHunkLowerNode = null;
|
|
510
544
|
diffHunkActiveChange = null;
|
|
545
|
+
diffHunkActiveHoverSide = null;
|
|
511
546
|
diffHunkLineChanges = [];
|
|
512
547
|
diffHunkFallbackLineChanges = [];
|
|
513
548
|
diffHunkFallbackVersions = null;
|
|
549
|
+
diffHunkActionInFlight = false;
|
|
550
|
+
diffComputedVersions = null;
|
|
551
|
+
diffPresentationDisposables = [];
|
|
552
|
+
fallbackOriginalDecorationIds = [];
|
|
553
|
+
fallbackModifiedDecorationIds = [];
|
|
514
554
|
diffHunkHideTimer = null;
|
|
515
555
|
diffUnchangedRegionDisposables = [];
|
|
516
556
|
diffUnchangedRegionObserver = null;
|
|
517
557
|
diffUnchangedBridgeOverlay = null;
|
|
518
|
-
|
|
558
|
+
diffUnchangedBridgeEntries = /* @__PURE__ */ new Map();
|
|
559
|
+
diffUnchangedBridgePool = [];
|
|
560
|
+
diffUnchangedNodeIds = /* @__PURE__ */ new WeakMap();
|
|
561
|
+
diffUnchangedNodeIdSequence = 0;
|
|
562
|
+
diffUnchangedOverlayScrollTop = 0;
|
|
563
|
+
diffUnchangedOverlayScrollLeft = 0;
|
|
564
|
+
diffRootAppearanceSignature = null;
|
|
519
565
|
diffPersistedUnchangedModelState = null;
|
|
566
|
+
pendingPreparedDiffViewModel = null;
|
|
567
|
+
diffModelTransitionRequestId = 0;
|
|
568
|
+
pendingDiffScrollRestorePosition = null;
|
|
569
|
+
pendingDiffScrollRestoreBudget = 0;
|
|
570
|
+
diffHideUnchangedRegionsResolved = null;
|
|
571
|
+
diffHideUnchangedRegionsDeferred = false;
|
|
572
|
+
diffHideUnchangedRegionsIdleTimer = null;
|
|
573
|
+
diffThemeSyncRafId = null;
|
|
520
574
|
constructor(options, maxHeightValue, maxHeightCSS, autoScrollOnUpdate, autoScrollInitial, autoScrollThresholdPx, autoScrollThresholdLines, diffAutoScroll, revealDebounceMsOption, diffUpdateThrottleMsOption) {
|
|
521
575
|
this.options = options;
|
|
522
576
|
this.maxHeightValue = maxHeightValue;
|
|
@@ -549,8 +603,204 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
549
603
|
enabled: true,
|
|
550
604
|
contextLineCount: 3,
|
|
551
605
|
minimumLineCount: 3,
|
|
552
|
-
revealLineCount:
|
|
606
|
+
revealLineCount: 5
|
|
607
|
+
};
|
|
608
|
+
}
|
|
609
|
+
resolveDiffLineStyleOption() {
|
|
610
|
+
return this.options.diffLineStyle === "bar" ? "bar" : "background";
|
|
611
|
+
}
|
|
612
|
+
resolveDiffUnchangedRegionStyleOption() {
|
|
613
|
+
if (this.options.diffUnchangedRegionStyle === "simple") return "simple";
|
|
614
|
+
if (this.options.diffUnchangedRegionStyle === "line-info-basic") return "line-info-basic";
|
|
615
|
+
return this.options.diffUnchangedRegionStyle === "metadata" ? "metadata" : "line-info";
|
|
616
|
+
}
|
|
617
|
+
resolveDiffStreamingThrottleMs() {
|
|
618
|
+
const explicitThrottle = this.diffUpdateThrottleMsOption ?? this.options.diffUpdateThrottleMs;
|
|
619
|
+
if (typeof explicitThrottle === "number") return explicitThrottle;
|
|
620
|
+
return 50;
|
|
621
|
+
}
|
|
622
|
+
parseCssColorRgb(color) {
|
|
623
|
+
const normalized = color.trim().toLowerCase();
|
|
624
|
+
const rgbMatch = normalized.match(/^rgba?\(\s*([+\-.\d]+)\s*,\s*([+\-.\d]+)\s*,\s*([+\-.\d]+)/);
|
|
625
|
+
if (rgbMatch) return [
|
|
626
|
+
Number.parseFloat(rgbMatch[1]),
|
|
627
|
+
Number.parseFloat(rgbMatch[2]),
|
|
628
|
+
Number.parseFloat(rgbMatch[3])
|
|
629
|
+
];
|
|
630
|
+
const hexMatch = normalized.match(/^#([\da-f]{3,8})$/i);
|
|
631
|
+
if (!hexMatch) return null;
|
|
632
|
+
const hex = hexMatch[1];
|
|
633
|
+
if (hex.length === 3 || hex.length === 4) return [
|
|
634
|
+
Number.parseInt(`${hex[0]}${hex[0]}`, 16),
|
|
635
|
+
Number.parseInt(`${hex[1]}${hex[1]}`, 16),
|
|
636
|
+
Number.parseInt(`${hex[2]}${hex[2]}`, 16)
|
|
637
|
+
];
|
|
638
|
+
if (hex.length === 6 || hex.length === 8) return [
|
|
639
|
+
Number.parseInt(hex.slice(0, 2), 16),
|
|
640
|
+
Number.parseInt(hex.slice(2, 4), 16),
|
|
641
|
+
Number.parseInt(hex.slice(4, 6), 16)
|
|
642
|
+
];
|
|
643
|
+
return null;
|
|
644
|
+
}
|
|
645
|
+
resolveCssColorLuminance(color) {
|
|
646
|
+
const rgb = this.parseCssColorRgb(color);
|
|
647
|
+
if (!rgb) return null;
|
|
648
|
+
const channel = (value) => {
|
|
649
|
+
const normalized = Math.max(0, Math.min(255, value)) / 255;
|
|
650
|
+
return normalized <= .03928 ? normalized / 12.92 : ((normalized + .055) / 1.055) ** 2.4;
|
|
553
651
|
};
|
|
652
|
+
const [r, g, b] = rgb;
|
|
653
|
+
return .2126 * channel(r) + .7152 * channel(g) + .0722 * channel(b);
|
|
654
|
+
}
|
|
655
|
+
resolveDiffUnchangedLineInfoRailMetrics(node) {
|
|
656
|
+
const editorRoot = node.closest(".monaco-editor");
|
|
657
|
+
if (!editorRoot) return {
|
|
658
|
+
leftInset: 0,
|
|
659
|
+
width: null
|
|
660
|
+
};
|
|
661
|
+
const editorRect = editorRoot.getBoundingClientRect();
|
|
662
|
+
const lineNumberNode = Array.from(editorRoot.querySelectorAll(".line-numbers")).find((candidate) => {
|
|
663
|
+
const rect = candidate.getBoundingClientRect();
|
|
664
|
+
return rect.width > 0 && rect.height > 0;
|
|
665
|
+
});
|
|
666
|
+
if (!lineNumberNode) return {
|
|
667
|
+
leftInset: 0,
|
|
668
|
+
width: null
|
|
669
|
+
};
|
|
670
|
+
const lineNumberRect = lineNumberNode.getBoundingClientRect();
|
|
671
|
+
return {
|
|
672
|
+
leftInset: Math.max(0, lineNumberRect.left - editorRect.left),
|
|
673
|
+
width: Math.max(0, lineNumberRect.width) || null
|
|
674
|
+
};
|
|
675
|
+
}
|
|
676
|
+
looksLikeDarkThemeName(themeName) {
|
|
677
|
+
if (!themeName) return false;
|
|
678
|
+
const normalized = themeName.toLowerCase();
|
|
679
|
+
return [
|
|
680
|
+
"dark",
|
|
681
|
+
"night",
|
|
682
|
+
"moon",
|
|
683
|
+
"black",
|
|
684
|
+
"dracula",
|
|
685
|
+
"mocha",
|
|
686
|
+
"frappe",
|
|
687
|
+
"macchiato",
|
|
688
|
+
"palenight",
|
|
689
|
+
"ocean",
|
|
690
|
+
"poimandres",
|
|
691
|
+
"monokai",
|
|
692
|
+
"laserwave",
|
|
693
|
+
"tokyo",
|
|
694
|
+
"slack-dark",
|
|
695
|
+
"rose-pine",
|
|
696
|
+
"github-dark",
|
|
697
|
+
"material-theme",
|
|
698
|
+
"one-dark",
|
|
699
|
+
"catppuccin-mocha",
|
|
700
|
+
"catppuccin-frappe",
|
|
701
|
+
"catppuccin-macchiato"
|
|
702
|
+
].some((token) => normalized.includes(token)) && !normalized.includes("light") && !normalized.includes("latte") && !normalized.includes("dawn") && !normalized.includes("lotus");
|
|
703
|
+
}
|
|
704
|
+
looksLikeLightThemeName(themeName) {
|
|
705
|
+
if (!themeName) return false;
|
|
706
|
+
const normalized = themeName.toLowerCase();
|
|
707
|
+
return [
|
|
708
|
+
"light",
|
|
709
|
+
"day",
|
|
710
|
+
"dawn",
|
|
711
|
+
"latte",
|
|
712
|
+
"solarized-light",
|
|
713
|
+
"github-light",
|
|
714
|
+
"rose-pine-dawn",
|
|
715
|
+
"catppuccin-latte",
|
|
716
|
+
"one-light",
|
|
717
|
+
"vitesse-light",
|
|
718
|
+
"snazzy-light",
|
|
719
|
+
"material-lighter",
|
|
720
|
+
"material-theme-lighter",
|
|
721
|
+
"lotus"
|
|
722
|
+
].some((token) => normalized.includes(token));
|
|
723
|
+
}
|
|
724
|
+
resolveDiffAppearanceOption() {
|
|
725
|
+
var _this$diffEditorView, _this$diffEditorView$, _this$diffEditorView$2, _this$diffEditorView2, _this$diffEditorView3, _this$diffEditorView4;
|
|
726
|
+
if (this.options.diffAppearance === "light") return "light";
|
|
727
|
+
if (this.options.diffAppearance === "dark") return "dark";
|
|
728
|
+
if (this.looksLikeDarkThemeName(this.options.theme)) return "dark";
|
|
729
|
+
if (this.looksLikeLightThemeName(this.options.theme)) return "light";
|
|
730
|
+
const appearanceProbeNodes = [
|
|
731
|
+
(_this$diffEditorView = this.diffEditorView) === null || _this$diffEditorView === void 0 || (_this$diffEditorView$2 = (_this$diffEditorView$ = _this$diffEditorView.getModifiedEditor()).getContainerDomNode) === null || _this$diffEditorView$2 === void 0 ? void 0 : _this$diffEditorView$2.call(_this$diffEditorView$),
|
|
732
|
+
(_this$diffEditorView2 = this.diffEditorView) === null || _this$diffEditorView2 === void 0 || (_this$diffEditorView4 = (_this$diffEditorView3 = _this$diffEditorView2.getOriginalEditor()).getContainerDomNode) === null || _this$diffEditorView4 === void 0 ? void 0 : _this$diffEditorView4.call(_this$diffEditorView3),
|
|
733
|
+
this.lastContainer
|
|
734
|
+
];
|
|
735
|
+
for (const node of appearanceProbeNodes) {
|
|
736
|
+
if (!(node instanceof HTMLElement)) continue;
|
|
737
|
+
const style = globalThis.getComputedStyle(node);
|
|
738
|
+
const editorSurface = node.querySelector(".monaco-editor .monaco-editor-background, .monaco-editor .margin, .monaco-editor .lines-content");
|
|
739
|
+
const candidates = [
|
|
740
|
+
style.getPropertyValue("--stream-monaco-editor-bg"),
|
|
741
|
+
style.getPropertyValue("--vscode-editor-background"),
|
|
742
|
+
editorSurface ? globalThis.getComputedStyle(editorSurface).backgroundColor : "",
|
|
743
|
+
style.backgroundColor
|
|
744
|
+
];
|
|
745
|
+
for (const color of candidates) {
|
|
746
|
+
const luminance = this.resolveCssColorLuminance(color);
|
|
747
|
+
if (luminance == null) continue;
|
|
748
|
+
return luminance <= .42 ? "dark" : "light";
|
|
749
|
+
}
|
|
750
|
+
}
|
|
751
|
+
return this.looksLikeDarkThemeName(this.options.theme) ? "dark" : "light";
|
|
752
|
+
}
|
|
753
|
+
syncDiffRootThemeVariables(appearance) {
|
|
754
|
+
var _this$diffEditorView5, _this$diffEditorView6, _this$diffEditorView7, _this$diffEditorView8, _this$diffEditorView9, _this$diffEditorView10;
|
|
755
|
+
if (!(this.lastContainer instanceof HTMLElement)) return;
|
|
756
|
+
const probeNodes = [
|
|
757
|
+
(_this$diffEditorView5 = this.diffEditorView) === null || _this$diffEditorView5 === void 0 || (_this$diffEditorView7 = (_this$diffEditorView6 = _this$diffEditorView5.getModifiedEditor()).getContainerDomNode) === null || _this$diffEditorView7 === void 0 ? void 0 : _this$diffEditorView7.call(_this$diffEditorView6),
|
|
758
|
+
(_this$diffEditorView8 = this.diffEditorView) === null || _this$diffEditorView8 === void 0 || (_this$diffEditorView10 = (_this$diffEditorView9 = _this$diffEditorView8.getOriginalEditor()).getContainerDomNode) === null || _this$diffEditorView10 === void 0 ? void 0 : _this$diffEditorView10.call(_this$diffEditorView9),
|
|
759
|
+
this.lastContainer
|
|
760
|
+
];
|
|
761
|
+
const containerStyle = globalThis.getComputedStyle(this.lastContainer);
|
|
762
|
+
const fixedBackgroundColor = containerStyle.getPropertyValue("--stream-monaco-fixed-editor-bg").trim() || null;
|
|
763
|
+
let backgroundColor = null;
|
|
764
|
+
let foregroundColor = null;
|
|
765
|
+
for (const node of probeNodes) {
|
|
766
|
+
if (!(node instanceof HTMLElement)) continue;
|
|
767
|
+
const backgroundProbe = node.querySelector(".monaco-editor-background, .margin, .lines-content") ?? node;
|
|
768
|
+
const foregroundProbe = node.querySelector(".view-lines, .monaco-editor, .view-overlays") ?? node;
|
|
769
|
+
const nextBackground = globalThis.getComputedStyle(backgroundProbe).backgroundColor;
|
|
770
|
+
if (!backgroundColor && this.resolveCssColorLuminance(nextBackground) != null) backgroundColor = nextBackground;
|
|
771
|
+
const nextForeground = globalThis.getComputedStyle(foregroundProbe).color;
|
|
772
|
+
if (!foregroundColor && this.resolveCssColorLuminance(nextForeground) != null) foregroundColor = nextForeground;
|
|
773
|
+
if (backgroundColor && foregroundColor) break;
|
|
774
|
+
}
|
|
775
|
+
const resolvedBackgroundColor = fixedBackgroundColor || backgroundColor || (appearance === "dark" ? "rgb(10 10 11)" : "rgb(255 255 255)");
|
|
776
|
+
if (resolvedBackgroundColor) this.lastContainer.style.setProperty("--stream-monaco-editor-bg", resolvedBackgroundColor);
|
|
777
|
+
else this.lastContainer.style.removeProperty("--stream-monaco-editor-bg");
|
|
778
|
+
if (foregroundColor) this.lastContainer.style.setProperty("--stream-monaco-editor-fg", foregroundColor);
|
|
779
|
+
else this.lastContainer.style.removeProperty("--stream-monaco-editor-fg");
|
|
780
|
+
}
|
|
781
|
+
applyDiffRootAppearanceClass() {
|
|
782
|
+
if (!this.lastContainer) return;
|
|
783
|
+
const resolvedAppearance = this.resolveDiffAppearanceOption();
|
|
784
|
+
this.syncDiffRootThemeVariables(resolvedAppearance);
|
|
785
|
+
const containerClassList = this.lastContainer.classList;
|
|
786
|
+
const activeLineStyleClass = `stream-monaco-diff-style-${this.resolveDiffLineStyleOption()}`;
|
|
787
|
+
const activeUnchangedRegionStyleClass = `stream-monaco-diff-unchanged-style-${this.resolveDiffUnchangedRegionStyleOption()}`;
|
|
788
|
+
const sideBySide = !this.isDiffInlineMode();
|
|
789
|
+
const activeLayoutModeClass = sideBySide ? "stream-monaco-diff-side-by-side" : "stream-monaco-diff-inline";
|
|
790
|
+
const activeAppearanceClass = `stream-monaco-diff-appearance-${resolvedAppearance}`;
|
|
791
|
+
const nextSignature = [
|
|
792
|
+
activeLineStyleClass,
|
|
793
|
+
activeUnchangedRegionStyleClass,
|
|
794
|
+
activeLayoutModeClass,
|
|
795
|
+
activeAppearanceClass
|
|
796
|
+
].join("|");
|
|
797
|
+
if (this.diffRootAppearanceSignature === nextSignature && containerClassList.contains("stream-monaco-diff-root")) return;
|
|
798
|
+
containerClassList.add("stream-monaco-diff-root");
|
|
799
|
+
for (const className of DiffEditorManager.diffLineStyleClasses) containerClassList.toggle(className, className === activeLineStyleClass);
|
|
800
|
+
for (const className of DiffEditorManager.diffUnchangedRegionStyleClasses) containerClassList.toggle(className, className === activeUnchangedRegionStyleClass);
|
|
801
|
+
for (const className of DiffEditorManager.diffLayoutModeClasses) containerClassList.toggle(className, className === activeLayoutModeClass);
|
|
802
|
+
for (const className of DiffEditorManager.diffAppearanceClasses) containerClassList.toggle(className, className === activeAppearanceClass);
|
|
803
|
+
this.diffRootAppearanceSignature = nextSignature;
|
|
554
804
|
}
|
|
555
805
|
disposeDiffHunkInteractions() {
|
|
556
806
|
if (this.diffHunkHideTimer != null) {
|
|
@@ -558,6 +808,7 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
558
808
|
this.diffHunkHideTimer = null;
|
|
559
809
|
}
|
|
560
810
|
this.diffHunkActiveChange = null;
|
|
811
|
+
this.diffHunkActiveHoverSide = null;
|
|
561
812
|
this.diffHunkLineChanges = [];
|
|
562
813
|
this.diffHunkFallbackLineChanges = [];
|
|
563
814
|
this.diffHunkFallbackVersions = null;
|
|
@@ -645,7 +896,7 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
645
896
|
getEffectiveLineChanges() {
|
|
646
897
|
if (!this.diffEditorView) return [];
|
|
647
898
|
const nativeLineChanges = this.diffEditorView.getLineChanges();
|
|
648
|
-
if (nativeLineChanges) {
|
|
899
|
+
if (nativeLineChanges && this.hasFreshNativeDiffResult()) {
|
|
649
900
|
this.diffHunkFallbackLineChanges = [];
|
|
650
901
|
this.diffHunkFallbackVersions = null;
|
|
651
902
|
return nativeLineChanges;
|
|
@@ -660,6 +911,71 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
660
911
|
this.diffHunkFallbackVersions = versions;
|
|
661
912
|
return this.diffHunkFallbackLineChanges;
|
|
662
913
|
}
|
|
914
|
+
captureCurrentDiffVersions() {
|
|
915
|
+
if (!this.originalModel || !this.modifiedModel) return null;
|
|
916
|
+
return {
|
|
917
|
+
original: this.originalModel.getAlternativeVersionId(),
|
|
918
|
+
modified: this.modifiedModel.getAlternativeVersionId()
|
|
919
|
+
};
|
|
920
|
+
}
|
|
921
|
+
hasFreshNativeDiffResult() {
|
|
922
|
+
const versions = this.captureCurrentDiffVersions();
|
|
923
|
+
return !!(versions && this.diffComputedVersions && versions.original === this.diffComputedVersions.original && versions.modified === this.diffComputedVersions.modified);
|
|
924
|
+
}
|
|
925
|
+
scheduleSyncDiffPresentationDecorations() {
|
|
926
|
+
this.rafScheduler.schedule("sync-diff-presentation", () => {
|
|
927
|
+
this.syncDiffPresentationDecorations();
|
|
928
|
+
});
|
|
929
|
+
}
|
|
930
|
+
clearFallbackDiffDecorations() {
|
|
931
|
+
var _this$diffEditorView11, _this$diffEditorView12;
|
|
932
|
+
const originalEditor = (_this$diffEditorView11 = this.diffEditorView) === null || _this$diffEditorView11 === void 0 ? void 0 : _this$diffEditorView11.getOriginalEditor();
|
|
933
|
+
const modifiedEditor = (_this$diffEditorView12 = this.diffEditorView) === null || _this$diffEditorView12 === void 0 ? void 0 : _this$diffEditorView12.getModifiedEditor();
|
|
934
|
+
if (originalEditor && this.fallbackOriginalDecorationIds.length > 0) this.fallbackOriginalDecorationIds = originalEditor.deltaDecorations(this.fallbackOriginalDecorationIds, []);
|
|
935
|
+
else this.fallbackOriginalDecorationIds = [];
|
|
936
|
+
if (modifiedEditor && this.fallbackModifiedDecorationIds.length > 0) this.fallbackModifiedDecorationIds = modifiedEditor.deltaDecorations(this.fallbackModifiedDecorationIds, []);
|
|
937
|
+
else this.fallbackModifiedDecorationIds = [];
|
|
938
|
+
}
|
|
939
|
+
toWholeLineDecoration(side, startLineNumber, endLineNumber) {
|
|
940
|
+
if (endLineNumber < startLineNumber || startLineNumber < 1) return null;
|
|
941
|
+
const removed = side === "original";
|
|
942
|
+
return {
|
|
943
|
+
range: new monaco_shim_exports.Range(startLineNumber, 1, endLineNumber, 1),
|
|
944
|
+
options: {
|
|
945
|
+
isWholeLine: true,
|
|
946
|
+
className: removed ? "stream-monaco-fallback-line-delete" : "stream-monaco-fallback-line-insert",
|
|
947
|
+
marginClassName: removed ? "stream-monaco-fallback-gutter-delete" : "stream-monaco-fallback-gutter-insert",
|
|
948
|
+
linesDecorationsClassName: removed ? "stream-monaco-fallback-lines-delete" : "stream-monaco-fallback-lines-insert",
|
|
949
|
+
lineNumberClassName: removed ? "stream-monaco-fallback-line-number-delete" : "stream-monaco-fallback-line-number-insert",
|
|
950
|
+
description: removed ? "stream-monaco-fallback-line-delete" : "stream-monaco-fallback-line-insert",
|
|
951
|
+
zIndex: 5
|
|
952
|
+
}
|
|
953
|
+
};
|
|
954
|
+
}
|
|
955
|
+
syncDiffPresentationDecorations() {
|
|
956
|
+
if (!this.diffEditorView || !this.lastContainer) return;
|
|
957
|
+
const nativeFresh = this.hasFreshNativeDiffResult();
|
|
958
|
+
this.lastContainer.classList.toggle("stream-monaco-diff-native-stale", !nativeFresh);
|
|
959
|
+
if (nativeFresh) {
|
|
960
|
+
this.clearFallbackDiffDecorations();
|
|
961
|
+
return;
|
|
962
|
+
}
|
|
963
|
+
const originalEditor = this.diffEditorView.getOriginalEditor();
|
|
964
|
+
const modifiedEditor = this.diffEditorView.getModifiedEditor();
|
|
965
|
+
const lineChanges = this.getEffectiveLineChanges();
|
|
966
|
+
const originalDecorations = lineChanges.map((change) => this.toWholeLineDecoration("original", change.originalStartLineNumber, change.originalEndLineNumber)).filter(Boolean);
|
|
967
|
+
const modifiedDecorations = lineChanges.map((change) => this.toWholeLineDecoration("modified", change.modifiedStartLineNumber, change.modifiedEndLineNumber)).filter(Boolean);
|
|
968
|
+
this.fallbackOriginalDecorationIds = originalEditor.deltaDecorations(this.fallbackOriginalDecorationIds, originalDecorations);
|
|
969
|
+
this.fallbackModifiedDecorationIds = modifiedEditor.deltaDecorations(this.fallbackModifiedDecorationIds, modifiedDecorations);
|
|
970
|
+
}
|
|
971
|
+
disposeDiffPresentationTracking() {
|
|
972
|
+
this.clearFallbackDiffDecorations();
|
|
973
|
+
if (this.lastContainer) this.lastContainer.classList.remove("stream-monaco-diff-native-stale");
|
|
974
|
+
this.diffComputedVersions = null;
|
|
975
|
+
this.diffPresentationDisposables.forEach((disposable) => disposable.dispose());
|
|
976
|
+
this.diffPresentationDisposables = [];
|
|
977
|
+
this.rafScheduler.cancel("sync-diff-presentation");
|
|
978
|
+
}
|
|
663
979
|
ensureDiffUiStyle() {
|
|
664
980
|
if (typeof document === "undefined") return;
|
|
665
981
|
if (document.getElementById(DiffEditorManager.diffUiStyleId)) return;
|
|
@@ -667,30 +983,549 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
667
983
|
style.id = DiffEditorManager.diffUiStyleId;
|
|
668
984
|
style.textContent = `
|
|
669
985
|
.stream-monaco-diff-root {
|
|
670
|
-
--stream-monaco-
|
|
671
|
-
--stream-monaco-unchanged-bg: var(--vscode-diffEditor-unchangedRegionBackground, transparent);
|
|
986
|
+
--stream-monaco-editor-fg: var(--vscode-editor-foreground, #111827);
|
|
672
987
|
--stream-monaco-editor-bg: var(--vscode-editor-background, #fff);
|
|
673
|
-
--stream-monaco-
|
|
674
|
-
--stream-monaco-
|
|
675
|
-
--stream-monaco-
|
|
676
|
-
--stream-monaco-
|
|
988
|
+
--stream-monaco-unchanged-fg: var(--vscode-diffEditor-unchangedRegionForeground, var(--stream-monaco-editor-fg));
|
|
989
|
+
--stream-monaco-unchanged-bg: var(--vscode-diffEditor-unchangedRegionBackground, transparent);
|
|
990
|
+
--stream-monaco-gutter-marker-width: 4px;
|
|
991
|
+
--stream-monaco-gutter-gap: 16px;
|
|
992
|
+
--stream-monaco-widget-shadow: var(--vscode-widget-shadow, rgb(15 23 42 / 26%));
|
|
993
|
+
--stream-monaco-focus: var(--vscode-focusBorder, color-mix(in srgb, var(--stream-monaco-editor-fg) 56%, transparent));
|
|
994
|
+
--stream-monaco-frame-radius: 20px;
|
|
995
|
+
--stream-monaco-frame-border: color-mix(in srgb, var(--stream-monaco-editor-fg) 12%, transparent);
|
|
996
|
+
--stream-monaco-frame-shadow: 0 28px 60px -46px var(--stream-monaco-widget-shadow);
|
|
997
|
+
--stream-monaco-panel-border: color-mix(in srgb, var(--stream-monaco-editor-fg) 9%, transparent);
|
|
998
|
+
--stream-monaco-pane-divider: var(--stream-monaco-panel-border);
|
|
999
|
+
--stream-monaco-line-number: color-mix(in srgb, var(--stream-monaco-editor-fg) 34%, transparent);
|
|
1000
|
+
--stream-monaco-line-number-active: color-mix(in srgb, var(--stream-monaco-editor-fg) 46%, transparent);
|
|
1001
|
+
--stream-monaco-line-number-left: calc(
|
|
1002
|
+
var(--stream-monaco-gutter-marker-width) + var(--stream-monaco-gutter-gap)
|
|
1003
|
+
);
|
|
1004
|
+
--stream-monaco-line-number-width: 36px;
|
|
1005
|
+
--stream-monaco-line-number-align: center;
|
|
1006
|
+
--stream-monaco-original-margin-width: calc(
|
|
1007
|
+
var(--stream-monaco-line-number-left) +
|
|
1008
|
+
var(--stream-monaco-line-number-width)
|
|
1009
|
+
);
|
|
1010
|
+
--stream-monaco-original-scrollable-left: var(
|
|
1011
|
+
--stream-monaco-original-margin-width
|
|
1012
|
+
);
|
|
1013
|
+
--stream-monaco-original-scrollable-width: calc(
|
|
1014
|
+
100% - var(--stream-monaco-original-margin-width)
|
|
1015
|
+
);
|
|
1016
|
+
--stream-monaco-modified-margin-width: calc(
|
|
1017
|
+
var(--stream-monaco-line-number-left) +
|
|
1018
|
+
var(--stream-monaco-line-number-width)
|
|
1019
|
+
);
|
|
1020
|
+
--stream-monaco-modified-scrollable-left: var(
|
|
1021
|
+
--stream-monaco-modified-margin-width
|
|
1022
|
+
);
|
|
1023
|
+
--stream-monaco-modified-scrollable-width: calc(
|
|
1024
|
+
100% - var(--stream-monaco-modified-margin-width)
|
|
1025
|
+
);
|
|
1026
|
+
--stream-monaco-panel-bg:
|
|
1027
|
+
linear-gradient(
|
|
1028
|
+
180deg,
|
|
1029
|
+
color-mix(in srgb, var(--stream-monaco-editor-bg) 97%, white 3%) 0%,
|
|
1030
|
+
color-mix(in srgb, var(--stream-monaco-editor-bg) 92%, var(--stream-monaco-editor-fg) 8%) 100%
|
|
1031
|
+
);
|
|
1032
|
+
--stream-monaco-panel-bg-soft: color-mix(in srgb, var(--stream-monaco-editor-bg) 94%, var(--stream-monaco-editor-fg) 6%);
|
|
1033
|
+
--stream-monaco-panel-bg-strong: color-mix(in srgb, var(--stream-monaco-editor-bg) 88%, var(--stream-monaco-editor-fg) 12%);
|
|
1034
|
+
--stream-monaco-gutter-bg:
|
|
1035
|
+
linear-gradient(
|
|
1036
|
+
180deg,
|
|
1037
|
+
color-mix(in srgb, var(--stream-monaco-editor-bg) 92%, var(--stream-monaco-editor-fg) 8%) 0%,
|
|
1038
|
+
color-mix(in srgb, var(--stream-monaco-editor-bg) 88%, var(--stream-monaco-editor-fg) 12%) 100%
|
|
1039
|
+
);
|
|
1040
|
+
--stream-monaco-gutter-guide: color-mix(in srgb, var(--stream-monaco-editor-fg) 14%, transparent);
|
|
1041
|
+
--stream-monaco-surface: color-mix(in srgb, var(--stream-monaco-unchanged-bg) 76%, var(--stream-monaco-editor-bg) 24%);
|
|
1042
|
+
--stream-monaco-surface-hover: color-mix(in srgb, var(--stream-monaco-unchanged-bg) 64%, var(--stream-monaco-editor-bg) 36%);
|
|
677
1043
|
--stream-monaco-surface-soft: color-mix(in srgb, var(--stream-monaco-unchanged-bg) 55%, transparent);
|
|
678
|
-
--stream-monaco-border: color-mix(in srgb, var(--stream-monaco-unchanged-fg)
|
|
679
|
-
--stream-monaco-border-strong: color-mix(in srgb, var(--stream-monaco-unchanged-fg)
|
|
680
|
-
--stream-monaco-muted: color-mix(in srgb, var(--stream-monaco-unchanged-fg)
|
|
681
|
-
--stream-monaco-
|
|
1044
|
+
--stream-monaco-border: color-mix(in srgb, var(--stream-monaco-unchanged-fg) 18%, transparent);
|
|
1045
|
+
--stream-monaco-border-strong: color-mix(in srgb, var(--stream-monaco-unchanged-fg) 30%, transparent);
|
|
1046
|
+
--stream-monaco-muted: color-mix(in srgb, var(--stream-monaco-unchanged-fg) 70%, transparent);
|
|
1047
|
+
--stream-monaco-added-fg: color-mix(in srgb, var(--vscode-diffEditorGutter-insertedLineBackground, #14b8a6) 78%, #0f766e 22%);
|
|
1048
|
+
--stream-monaco-added-line: color-mix(in srgb, var(--vscode-diffEditor-insertedLineBackground, #ddfbe8) 88%, var(--stream-monaco-editor-bg) 12%);
|
|
1049
|
+
--stream-monaco-added-inline: color-mix(in srgb, var(--vscode-diffEditor-insertedTextBackground, #baf5d1) 92%, var(--stream-monaco-editor-bg) 8%);
|
|
1050
|
+
--stream-monaco-added-border: color-mix(in srgb, var(--stream-monaco-added-fg) 24%, transparent);
|
|
1051
|
+
--stream-monaco-added-outline: var(--stream-monaco-added-border);
|
|
1052
|
+
--stream-monaco-added-inline-border: var(--stream-monaco-added-border);
|
|
1053
|
+
--stream-monaco-added-line-shadow:
|
|
1054
|
+
inset 4px 0 0 var(--stream-monaco-added-fg),
|
|
1055
|
+
inset 0 0 0 1px var(--stream-monaco-added-outline);
|
|
1056
|
+
--stream-monaco-added-line-fill:
|
|
1057
|
+
linear-gradient(
|
|
1058
|
+
90deg,
|
|
1059
|
+
color-mix(in srgb, var(--stream-monaco-added-line) 94%, var(--stream-monaco-editor-bg) 6%) 0%,
|
|
1060
|
+
color-mix(in srgb, var(--stream-monaco-added-line) 82%, transparent) 100%
|
|
1061
|
+
);
|
|
1062
|
+
--stream-monaco-added-gutter:
|
|
1063
|
+
linear-gradient(
|
|
1064
|
+
90deg,
|
|
1065
|
+
var(--stream-monaco-added-fg) 0 4px,
|
|
1066
|
+
color-mix(in srgb, var(--stream-monaco-added-line) 82%, transparent) 4px 100%
|
|
1067
|
+
);
|
|
1068
|
+
--stream-monaco-removed-fg: color-mix(in srgb, var(--vscode-diffEditorGutter-removedLineBackground, #f43f5e) 74%, #dc2626 26%);
|
|
1069
|
+
--stream-monaco-removed-line: color-mix(in srgb, var(--vscode-diffEditor-removedLineBackground, #fde8ec) 88%, var(--stream-monaco-editor-bg) 12%);
|
|
1070
|
+
--stream-monaco-removed-inline: color-mix(in srgb, var(--vscode-diffEditor-removedTextBackground, #fecdd6) 92%, var(--stream-monaco-editor-bg) 8%);
|
|
1071
|
+
--stream-monaco-removed-border: color-mix(in srgb, var(--stream-monaco-removed-fg) 24%, transparent);
|
|
1072
|
+
--stream-monaco-removed-outline: var(--stream-monaco-removed-border);
|
|
1073
|
+
--stream-monaco-removed-inline-border: var(--stream-monaco-removed-border);
|
|
1074
|
+
--stream-monaco-removed-line-shadow:
|
|
1075
|
+
inset 4px 0 0 var(--stream-monaco-removed-fg),
|
|
1076
|
+
inset 0 0 0 1px var(--stream-monaco-removed-outline);
|
|
1077
|
+
--stream-monaco-removed-line-fill:
|
|
1078
|
+
linear-gradient(
|
|
1079
|
+
90deg,
|
|
1080
|
+
color-mix(in srgb, var(--stream-monaco-removed-line) 94%, var(--stream-monaco-editor-bg) 6%) 0%,
|
|
1081
|
+
color-mix(in srgb, var(--stream-monaco-removed-line) 82%, transparent) 100%
|
|
1082
|
+
);
|
|
1083
|
+
--stream-monaco-removed-gutter:
|
|
1084
|
+
linear-gradient(
|
|
1085
|
+
90deg,
|
|
1086
|
+
var(--stream-monaco-removed-fg) 0 4px,
|
|
1087
|
+
color-mix(in srgb, var(--stream-monaco-removed-line) 82%, transparent) 4px 100%
|
|
1088
|
+
);
|
|
1089
|
+
scrollbar-width: none;
|
|
1090
|
+
color-scheme: light;
|
|
1091
|
+
}
|
|
1092
|
+
.stream-monaco-diff-root.stream-monaco-diff-appearance-dark {
|
|
1093
|
+
--stream-monaco-frame-border: color-mix(in srgb, var(--stream-monaco-editor-fg) 16%, transparent);
|
|
1094
|
+
--stream-monaco-frame-shadow: 0 30px 60px -42px rgb(2 6 23 / 0.78);
|
|
1095
|
+
--stream-monaco-panel-border: color-mix(in srgb, var(--stream-monaco-editor-fg) 15%, transparent);
|
|
1096
|
+
--stream-monaco-pane-divider: color-mix(in srgb, var(--stream-monaco-editor-fg) 12%, transparent);
|
|
1097
|
+
--stream-monaco-panel-bg:
|
|
1098
|
+
linear-gradient(
|
|
1099
|
+
180deg,
|
|
1100
|
+
color-mix(in srgb, var(--stream-monaco-editor-bg) 94%, black 6%) 0%,
|
|
1101
|
+
color-mix(in srgb, var(--stream-monaco-editor-bg) 82%, var(--stream-monaco-editor-fg) 18%) 100%
|
|
1102
|
+
);
|
|
1103
|
+
--stream-monaco-panel-bg-soft: color-mix(in srgb, var(--stream-monaco-editor-bg) 86%, var(--stream-monaco-editor-fg) 14%);
|
|
1104
|
+
--stream-monaco-panel-bg-strong: color-mix(in srgb, var(--stream-monaco-editor-bg) 78%, var(--stream-monaco-editor-fg) 22%);
|
|
1105
|
+
--stream-monaco-gutter-bg:
|
|
1106
|
+
linear-gradient(
|
|
1107
|
+
180deg,
|
|
1108
|
+
color-mix(in srgb, var(--stream-monaco-editor-bg) 84%, black 16%) 0%,
|
|
1109
|
+
color-mix(in srgb, var(--stream-monaco-editor-bg) 76%, var(--stream-monaco-editor-fg) 24%) 100%
|
|
1110
|
+
);
|
|
1111
|
+
--stream-monaco-gutter-guide: color-mix(in srgb, var(--stream-monaco-editor-fg) 12%, transparent);
|
|
1112
|
+
--stream-monaco-surface: color-mix(in srgb, var(--stream-monaco-editor-bg) 91%, var(--stream-monaco-unchanged-fg) 9%);
|
|
1113
|
+
--stream-monaco-surface-hover: color-mix(in srgb, var(--stream-monaco-editor-bg) 84%, var(--stream-monaco-unchanged-fg) 16%);
|
|
1114
|
+
--stream-monaco-surface-soft: color-mix(in srgb, var(--stream-monaco-editor-bg) 78%, var(--stream-monaco-unchanged-fg) 22%);
|
|
1115
|
+
--stream-monaco-border: color-mix(in srgb, var(--stream-monaco-editor-fg) 22%, transparent);
|
|
1116
|
+
--stream-monaco-border-strong: color-mix(in srgb, var(--stream-monaco-editor-fg) 30%, transparent);
|
|
1117
|
+
--stream-monaco-muted: color-mix(in srgb, var(--stream-monaco-editor-fg) 72%, transparent);
|
|
1118
|
+
--stream-monaco-added-fg: color-mix(in srgb, var(--vscode-diffEditorGutter-insertedLineBackground, #2dd4bf) 88%, #99f6e4 12%);
|
|
1119
|
+
--stream-monaco-added-line: color-mix(in srgb, var(--vscode-diffEditor-insertedLineBackground, rgb(16 185 129 / 0.24)) 54%, var(--stream-monaco-editor-bg) 46%);
|
|
1120
|
+
--stream-monaco-added-inline: color-mix(in srgb, var(--vscode-diffEditor-insertedTextBackground, rgb(45 212 191 / 0.26)) 62%, var(--stream-monaco-editor-bg) 38%);
|
|
1121
|
+
--stream-monaco-added-border: color-mix(in srgb, var(--stream-monaco-added-fg) 32%, transparent);
|
|
1122
|
+
--stream-monaco-added-outline: color-mix(in srgb, var(--stream-monaco-added-fg) 20%, transparent);
|
|
1123
|
+
--stream-monaco-added-inline-border: color-mix(in srgb, var(--stream-monaco-added-fg) 26%, transparent);
|
|
1124
|
+
--stream-monaco-added-line-shadow:
|
|
1125
|
+
inset 4px 0 0 var(--stream-monaco-added-fg),
|
|
1126
|
+
inset 0 0 0 1px var(--stream-monaco-added-outline);
|
|
1127
|
+
--stream-monaco-added-line-fill:
|
|
1128
|
+
linear-gradient(
|
|
1129
|
+
90deg,
|
|
1130
|
+
color-mix(in srgb, var(--stream-monaco-added-line) 96%, var(--stream-monaco-editor-bg) 4%) 0%,
|
|
1131
|
+
color-mix(in srgb, var(--stream-monaco-added-line) 74%, transparent) 100%
|
|
1132
|
+
);
|
|
1133
|
+
--stream-monaco-added-gutter:
|
|
1134
|
+
linear-gradient(
|
|
1135
|
+
90deg,
|
|
1136
|
+
var(--stream-monaco-added-fg) 0 4px,
|
|
1137
|
+
color-mix(in srgb, var(--stream-monaco-added-line) 74%, transparent) 4px 100%
|
|
1138
|
+
);
|
|
1139
|
+
--stream-monaco-removed-fg: color-mix(in srgb, var(--vscode-diffEditorGutter-removedLineBackground, #fb7185) 86%, #fecdd3 14%);
|
|
1140
|
+
--stream-monaco-removed-line: color-mix(in srgb, var(--vscode-diffEditor-removedLineBackground, rgb(244 63 94 / 0.22)) 54%, var(--stream-monaco-editor-bg) 46%);
|
|
1141
|
+
--stream-monaco-removed-inline: color-mix(in srgb, var(--vscode-diffEditor-removedTextBackground, rgb(251 113 133 / 0.24)) 62%, var(--stream-monaco-editor-bg) 38%);
|
|
1142
|
+
--stream-monaco-removed-border: color-mix(in srgb, var(--stream-monaco-removed-fg) 32%, transparent);
|
|
1143
|
+
--stream-monaco-removed-outline: color-mix(in srgb, var(--stream-monaco-removed-fg) 20%, transparent);
|
|
1144
|
+
--stream-monaco-removed-inline-border: color-mix(in srgb, var(--stream-monaco-removed-fg) 26%, transparent);
|
|
1145
|
+
--stream-monaco-removed-line-shadow:
|
|
1146
|
+
inset 4px 0 0 var(--stream-monaco-removed-fg),
|
|
1147
|
+
inset 0 0 0 1px var(--stream-monaco-removed-outline);
|
|
1148
|
+
--stream-monaco-removed-line-fill:
|
|
1149
|
+
linear-gradient(
|
|
1150
|
+
90deg,
|
|
1151
|
+
color-mix(in srgb, var(--stream-monaco-removed-line) 96%, var(--stream-monaco-editor-bg) 4%) 0%,
|
|
1152
|
+
color-mix(in srgb, var(--stream-monaco-removed-line) 74%, transparent) 100%
|
|
1153
|
+
);
|
|
1154
|
+
--stream-monaco-removed-gutter:
|
|
1155
|
+
linear-gradient(
|
|
1156
|
+
90deg,
|
|
1157
|
+
var(--stream-monaco-removed-fg) 0 4px,
|
|
1158
|
+
color-mix(in srgb, var(--stream-monaco-removed-line) 74%, transparent) 4px 100%
|
|
1159
|
+
);
|
|
1160
|
+
color-scheme: dark;
|
|
1161
|
+
}
|
|
1162
|
+
.stream-monaco-diff-root::-webkit-scrollbar {
|
|
1163
|
+
width: 0;
|
|
1164
|
+
height: 0;
|
|
1165
|
+
display: none;
|
|
1166
|
+
}
|
|
1167
|
+
.stream-monaco-diff-root .monaco-diff-editor {
|
|
1168
|
+
overflow: hidden;
|
|
1169
|
+
background: var(--stream-monaco-panel-bg);
|
|
1170
|
+
box-shadow: var(--stream-monaco-frame-shadow);
|
|
1171
|
+
}
|
|
1172
|
+
.stream-monaco-diff-root .monaco-diff-editor.side-by-side .editor.original .scrollbar.vertical,
|
|
1173
|
+
.stream-monaco-diff-root .monaco-diff-editor.side-by-side .editor.modified .scrollbar.vertical {
|
|
1174
|
+
display: none !important;
|
|
1175
|
+
}
|
|
1176
|
+
.stream-monaco-diff-root .monaco-diff-editor.side-by-side {
|
|
1177
|
+
background:
|
|
1178
|
+
radial-gradient(circle at top center, color-mix(in srgb, var(--stream-monaco-editor-bg) 82%, white 18%) 0%, transparent 44%),
|
|
1179
|
+
var(--stream-monaco-panel-bg);
|
|
1180
|
+
}
|
|
1181
|
+
.stream-monaco-diff-root.stream-monaco-diff-appearance-dark .monaco-diff-editor.side-by-side {
|
|
1182
|
+
background:
|
|
1183
|
+
radial-gradient(circle at top center, color-mix(in srgb, var(--stream-monaco-editor-bg) 88%, black 12%) 0%, transparent 48%),
|
|
1184
|
+
var(--stream-monaco-panel-bg);
|
|
1185
|
+
}
|
|
1186
|
+
.stream-monaco-diff-root .monaco-diff-editor .editor.original,
|
|
1187
|
+
.stream-monaco-diff-root .monaco-diff-editor .editor.modified {
|
|
1188
|
+
background:
|
|
1189
|
+
linear-gradient(
|
|
1190
|
+
180deg,
|
|
1191
|
+
color-mix(in srgb, var(--stream-monaco-editor-bg) 98%, white 2%) 0%,
|
|
1192
|
+
var(--stream-monaco-editor-bg) 100%
|
|
1193
|
+
);
|
|
1194
|
+
}
|
|
1195
|
+
.stream-monaco-diff-root.stream-monaco-diff-appearance-dark .monaco-diff-editor .editor.original,
|
|
1196
|
+
.stream-monaco-diff-root.stream-monaco-diff-appearance-dark .monaco-diff-editor .editor.modified {
|
|
1197
|
+
background:
|
|
1198
|
+
linear-gradient(
|
|
1199
|
+
180deg,
|
|
1200
|
+
color-mix(in srgb, var(--stream-monaco-editor-bg) 94%, black 6%) 0%,
|
|
1201
|
+
var(--stream-monaco-editor-bg) 100%
|
|
1202
|
+
);
|
|
1203
|
+
}
|
|
1204
|
+
.stream-monaco-diff-root .monaco-diff-editor .editor.original .monaco-editor-background,
|
|
1205
|
+
.stream-monaco-diff-root .monaco-diff-editor .editor.original .margin,
|
|
1206
|
+
.stream-monaco-diff-root .monaco-diff-editor .editor.original .margin-view-overlays,
|
|
1207
|
+
.stream-monaco-diff-root .monaco-diff-editor .editor.original .margin-view-zones,
|
|
1208
|
+
.stream-monaco-diff-root .monaco-diff-editor .editor.original .lines-content,
|
|
1209
|
+
.stream-monaco-diff-root .monaco-diff-editor .editor.modified .monaco-editor-background,
|
|
1210
|
+
.stream-monaco-diff-root .monaco-diff-editor .editor.modified .margin,
|
|
1211
|
+
.stream-monaco-diff-root .monaco-diff-editor .editor.modified .margin-view-overlays,
|
|
1212
|
+
.stream-monaco-diff-root .monaco-diff-editor .editor.modified .margin-view-zones,
|
|
1213
|
+
.stream-monaco-diff-root .monaco-diff-editor .editor.modified .lines-content {
|
|
1214
|
+
background: var(--stream-monaco-editor-bg) !important;
|
|
1215
|
+
}
|
|
1216
|
+
.stream-monaco-diff-root .monaco-diff-editor.side-by-side .editor.modified {
|
|
1217
|
+
box-shadow: none;
|
|
1218
|
+
border-left: 1px solid var(--stream-monaco-pane-divider);
|
|
1219
|
+
}
|
|
1220
|
+
.stream-monaco-diff-root .monaco-diff-editor.side-by-side .editor.original {
|
|
1221
|
+
box-shadow: none;
|
|
1222
|
+
border-right: 1px solid var(--stream-monaco-pane-divider);
|
|
1223
|
+
}
|
|
1224
|
+
.stream-monaco-diff-root .monaco-diff-editor .gutter {
|
|
1225
|
+
background: var(--stream-monaco-gutter-bg);
|
|
1226
|
+
border-inline: 1px solid var(--stream-monaco-pane-divider);
|
|
1227
|
+
}
|
|
1228
|
+
.stream-monaco-diff-root .monaco-diff-editor .gutter .background {
|
|
1229
|
+
left: 50%;
|
|
1230
|
+
width: 1px;
|
|
1231
|
+
border-left: 0 !important;
|
|
1232
|
+
background: var(--stream-monaco-gutter-guide);
|
|
1233
|
+
}
|
|
1234
|
+
.stream-monaco-diff-root .monaco-diff-editor .gutter .buttons .monaco-toolbar .monaco-action-bar .actions-container {
|
|
1235
|
+
border-radius: 999px;
|
|
1236
|
+
border: 1px solid var(--stream-monaco-panel-border);
|
|
1237
|
+
background: color-mix(in srgb, var(--stream-monaco-editor-bg) 84%, var(--stream-monaco-editor-fg) 16%);
|
|
1238
|
+
box-shadow: 0 14px 24px -18px var(--stream-monaco-widget-shadow);
|
|
1239
|
+
}
|
|
1240
|
+
.stream-monaco-diff-root .monaco-diff-editor .gutter .buttons .monaco-toolbar .monaco-action-bar .actions-container .action-item {
|
|
1241
|
+
border-radius: 999px;
|
|
1242
|
+
}
|
|
1243
|
+
.stream-monaco-diff-root .monaco-diff-editor .insert-sign,
|
|
1244
|
+
.stream-monaco-diff-root .monaco-diff-editor .delete-sign {
|
|
1245
|
+
display: none !important;
|
|
1246
|
+
}
|
|
1247
|
+
.stream-monaco-diff-root .monaco-diff-editor .gutter-insert {
|
|
1248
|
+
background: var(--stream-monaco-added-gutter) !important;
|
|
1249
|
+
}
|
|
1250
|
+
.stream-monaco-diff-root .monaco-diff-editor .gutter-delete,
|
|
1251
|
+
.stream-monaco-diff-root .monaco-editor .inline-deleted-margin-view-zone {
|
|
1252
|
+
background: var(--stream-monaco-removed-gutter) !important;
|
|
1253
|
+
}
|
|
1254
|
+
.stream-monaco-diff-root .monaco-editor .line-insert,
|
|
1255
|
+
.stream-monaco-diff-root .monaco-diff-editor .line-insert {
|
|
1256
|
+
background: var(--stream-monaco-added-line-fill) !important;
|
|
1257
|
+
border: 0 !important;
|
|
1258
|
+
box-shadow: var(--stream-monaco-added-line-shadow);
|
|
1259
|
+
}
|
|
1260
|
+
.stream-monaco-diff-root .monaco-editor .line-delete,
|
|
1261
|
+
.stream-monaco-diff-root .monaco-diff-editor .line-delete {
|
|
1262
|
+
background: var(--stream-monaco-removed-line-fill) !important;
|
|
1263
|
+
border: 0 !important;
|
|
1264
|
+
box-shadow: var(--stream-monaco-removed-line-shadow);
|
|
1265
|
+
}
|
|
1266
|
+
.stream-monaco-diff-root .monaco-editor .char-insert,
|
|
1267
|
+
.stream-monaco-diff-root .monaco-diff-editor .char-insert {
|
|
1268
|
+
background: var(--stream-monaco-added-inline) !important;
|
|
1269
|
+
border: 1px solid var(--stream-monaco-added-inline-border) !important;
|
|
1270
|
+
border-radius: 6px;
|
|
1271
|
+
box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--stream-monaco-added-fg) 18%, transparent);
|
|
1272
|
+
}
|
|
1273
|
+
.stream-monaco-diff-root .monaco-editor .char-delete,
|
|
1274
|
+
.stream-monaco-diff-root .monaco-diff-editor .char-delete,
|
|
1275
|
+
.stream-monaco-diff-root .monaco-editor .inline-deleted-text {
|
|
1276
|
+
background: var(--stream-monaco-removed-inline) !important;
|
|
1277
|
+
border: 1px solid var(--stream-monaco-removed-inline-border) !important;
|
|
1278
|
+
border-radius: 6px;
|
|
1279
|
+
box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--stream-monaco-removed-fg) 18%, transparent);
|
|
1280
|
+
}
|
|
1281
|
+
.stream-monaco-diff-root .monaco-editor .inline-deleted-text {
|
|
1282
|
+
text-decoration: none;
|
|
1283
|
+
}
|
|
1284
|
+
.stream-monaco-diff-root .monaco-editor .char-insert.diff-range-empty,
|
|
1285
|
+
.stream-monaco-diff-root .monaco-editor .char-delete.diff-range-empty {
|
|
1286
|
+
min-width: 2px;
|
|
1287
|
+
margin: 0 1px;
|
|
1288
|
+
border-radius: 999px;
|
|
1289
|
+
}
|
|
1290
|
+
.stream-monaco-diff-root.stream-monaco-diff-native-stale .monaco-editor .line-insert,
|
|
1291
|
+
.stream-monaco-diff-root.stream-monaco-diff-native-stale .monaco-diff-editor .line-insert,
|
|
1292
|
+
.stream-monaco-diff-root.stream-monaco-diff-native-stale .monaco-editor .line-delete,
|
|
1293
|
+
.stream-monaco-diff-root.stream-monaco-diff-native-stale .monaco-diff-editor .line-delete,
|
|
1294
|
+
.stream-monaco-diff-root.stream-monaco-diff-native-stale .monaco-editor .char-insert,
|
|
1295
|
+
.stream-monaco-diff-root.stream-monaco-diff-native-stale .monaco-diff-editor .char-insert,
|
|
1296
|
+
.stream-monaco-diff-root.stream-monaco-diff-native-stale .monaco-editor .char-delete,
|
|
1297
|
+
.stream-monaco-diff-root.stream-monaco-diff-native-stale .monaco-diff-editor .char-delete,
|
|
1298
|
+
.stream-monaco-diff-root.stream-monaco-diff-native-stale .monaco-editor .inline-deleted-text,
|
|
1299
|
+
.stream-monaco-diff-root.stream-monaco-diff-native-stale .monaco-diff-editor .gutter-insert,
|
|
1300
|
+
.stream-monaco-diff-root.stream-monaco-diff-native-stale .monaco-diff-editor .gutter-delete,
|
|
1301
|
+
.stream-monaco-diff-root.stream-monaco-diff-native-stale .monaco-editor .inline-deleted-margin-view-zone {
|
|
1302
|
+
background: transparent !important;
|
|
1303
|
+
border-color: transparent !important;
|
|
1304
|
+
box-shadow: none !important;
|
|
1305
|
+
}
|
|
1306
|
+
.stream-monaco-diff-root.stream-monaco-diff-native-stale .monaco-editor .line-delete.line-numbers,
|
|
1307
|
+
.stream-monaco-diff-root.stream-monaco-diff-native-stale .monaco-diff-editor .line-delete.line-numbers,
|
|
1308
|
+
.stream-monaco-diff-root.stream-monaco-diff-native-stale .monaco-editor .line-insert.line-numbers,
|
|
1309
|
+
.stream-monaco-diff-root.stream-monaco-diff-native-stale .monaco-diff-editor .line-insert.line-numbers {
|
|
1310
|
+
color: var(--stream-monaco-line-number) !important;
|
|
1311
|
+
}
|
|
1312
|
+
.stream-monaco-diff-root .monaco-editor .stream-monaco-fallback-line-insert,
|
|
1313
|
+
.stream-monaco-diff-root .monaco-diff-editor .stream-monaco-fallback-line-insert {
|
|
1314
|
+
background: var(--stream-monaco-added-line-fill) !important;
|
|
1315
|
+
border: 0 !important;
|
|
1316
|
+
box-shadow: var(--stream-monaco-added-line-shadow);
|
|
1317
|
+
}
|
|
1318
|
+
.stream-monaco-diff-root .monaco-editor .stream-monaco-fallback-line-delete,
|
|
1319
|
+
.stream-monaco-diff-root .monaco-diff-editor .stream-monaco-fallback-line-delete {
|
|
1320
|
+
background: var(--stream-monaco-removed-line-fill) !important;
|
|
1321
|
+
border: 0 !important;
|
|
1322
|
+
box-shadow: var(--stream-monaco-removed-line-shadow);
|
|
1323
|
+
}
|
|
1324
|
+
.stream-monaco-diff-root .monaco-editor .stream-monaco-fallback-gutter-insert,
|
|
1325
|
+
.stream-monaco-diff-root .monaco-diff-editor .stream-monaco-fallback-gutter-insert {
|
|
1326
|
+
background: var(--stream-monaco-added-gutter) !important;
|
|
1327
|
+
}
|
|
1328
|
+
.stream-monaco-diff-root .monaco-editor .stream-monaco-fallback-gutter-delete,
|
|
1329
|
+
.stream-monaco-diff-root .monaco-diff-editor .stream-monaco-fallback-gutter-delete {
|
|
1330
|
+
background: var(--stream-monaco-removed-gutter) !important;
|
|
1331
|
+
}
|
|
1332
|
+
.stream-monaco-diff-root .monaco-editor .stream-monaco-fallback-line-number-delete,
|
|
1333
|
+
.stream-monaco-diff-root .monaco-diff-editor .stream-monaco-fallback-line-number-delete {
|
|
1334
|
+
color: var(--stream-monaco-removed-fg) !important;
|
|
1335
|
+
}
|
|
1336
|
+
.stream-monaco-diff-root .monaco-editor .stream-monaco-fallback-line-number-insert,
|
|
1337
|
+
.stream-monaco-diff-root .monaco-diff-editor .stream-monaco-fallback-line-number-insert {
|
|
1338
|
+
color: var(--stream-monaco-added-fg) !important;
|
|
1339
|
+
}
|
|
1340
|
+
.stream-monaco-diff-root.stream-monaco-diff-style-bar .monaco-diff-editor .gutter-insert {
|
|
1341
|
+
background:
|
|
1342
|
+
linear-gradient(
|
|
1343
|
+
90deg,
|
|
1344
|
+
var(--stream-monaco-added-fg) 0 4px,
|
|
1345
|
+
transparent 4px 100%
|
|
1346
|
+
) !important;
|
|
1347
|
+
}
|
|
1348
|
+
.stream-monaco-diff-root.stream-monaco-diff-style-bar .monaco-diff-editor .gutter-delete,
|
|
1349
|
+
.stream-monaco-diff-root.stream-monaco-diff-style-bar .monaco-editor .inline-deleted-margin-view-zone {
|
|
1350
|
+
background:
|
|
1351
|
+
linear-gradient(
|
|
1352
|
+
90deg,
|
|
1353
|
+
var(--stream-monaco-removed-fg) 0 4px,
|
|
1354
|
+
transparent 4px 100%
|
|
1355
|
+
) !important;
|
|
1356
|
+
}
|
|
1357
|
+
.stream-monaco-diff-root.stream-monaco-diff-style-bar .monaco-editor .line-insert,
|
|
1358
|
+
.stream-monaco-diff-root.stream-monaco-diff-style-bar .monaco-diff-editor .line-insert {
|
|
1359
|
+
background:
|
|
1360
|
+
color-mix(in srgb, var(--stream-monaco-added-line) 34%, transparent) !important;
|
|
1361
|
+
box-shadow: none !important;
|
|
1362
|
+
}
|
|
1363
|
+
.stream-monaco-diff-root.stream-monaco-diff-style-bar .monaco-editor .line-delete,
|
|
1364
|
+
.stream-monaco-diff-root.stream-monaco-diff-style-bar .monaco-diff-editor .line-delete {
|
|
1365
|
+
background:
|
|
1366
|
+
color-mix(in srgb, var(--stream-monaco-removed-line) 34%, transparent) !important;
|
|
1367
|
+
box-shadow: none !important;
|
|
1368
|
+
}
|
|
1369
|
+
.stream-monaco-diff-root.stream-monaco-diff-style-bar .monaco-editor .char-insert,
|
|
1370
|
+
.stream-monaco-diff-root.stream-monaco-diff-style-bar .monaco-diff-editor .char-insert {
|
|
1371
|
+
background:
|
|
1372
|
+
color-mix(in srgb, var(--stream-monaco-added-inline) 76%, transparent) !important;
|
|
1373
|
+
border: 0 !important;
|
|
1374
|
+
border-bottom: 1px solid
|
|
1375
|
+
color-mix(in srgb, var(--stream-monaco-added-fg) 30%, transparent) !important;
|
|
1376
|
+
box-shadow: inset 0 -1px 0
|
|
1377
|
+
color-mix(in srgb, var(--stream-monaco-added-fg) 26%, transparent);
|
|
1378
|
+
}
|
|
1379
|
+
.stream-monaco-diff-root.stream-monaco-diff-style-bar .monaco-editor .char-delete,
|
|
1380
|
+
.stream-monaco-diff-root.stream-monaco-diff-style-bar .monaco-diff-editor .char-delete,
|
|
1381
|
+
.stream-monaco-diff-root.stream-monaco-diff-style-bar .monaco-editor .inline-deleted-text {
|
|
1382
|
+
background:
|
|
1383
|
+
color-mix(in srgb, var(--stream-monaco-removed-inline) 76%, transparent) !important;
|
|
1384
|
+
border: 0 !important;
|
|
1385
|
+
border-bottom: 1px solid
|
|
1386
|
+
color-mix(in srgb, var(--stream-monaco-removed-fg) 30%, transparent) !important;
|
|
1387
|
+
box-shadow: inset 0 -1px 0
|
|
1388
|
+
color-mix(in srgb, var(--stream-monaco-removed-fg) 26%, transparent);
|
|
1389
|
+
}
|
|
1390
|
+
.stream-monaco-diff-root .monaco-diff-editor .diffOverview {
|
|
1391
|
+
background: color-mix(in srgb, var(--stream-monaco-editor-bg) 84%, var(--stream-monaco-editor-fg) 16%);
|
|
1392
|
+
border-left: 1px solid var(--stream-monaco-panel-border);
|
|
1393
|
+
}
|
|
1394
|
+
.stream-monaco-diff-root.stream-monaco-diff-appearance-dark .monaco-diff-editor .diffOverview {
|
|
1395
|
+
background:
|
|
1396
|
+
linear-gradient(
|
|
1397
|
+
180deg,
|
|
1398
|
+
color-mix(in srgb, var(--stream-monaco-editor-bg) 96%, black 4%) 0%,
|
|
1399
|
+
color-mix(in srgb, var(--stream-monaco-editor-bg) 90%, var(--stream-monaco-editor-fg) 10%) 100%
|
|
1400
|
+
);
|
|
1401
|
+
border-left-color: color-mix(in srgb, var(--stream-monaco-editor-fg) 10%, transparent);
|
|
1402
|
+
box-shadow: inset 1px 0 0 rgb(255 255 255 / 0.03);
|
|
1403
|
+
}
|
|
1404
|
+
.stream-monaco-diff-root .monaco-diff-editor .diffViewport {
|
|
1405
|
+
border-radius: 999px;
|
|
1406
|
+
background: color-mix(in srgb, var(--stream-monaco-editor-fg) 18%, transparent);
|
|
1407
|
+
}
|
|
1408
|
+
.stream-monaco-diff-root.stream-monaco-diff-appearance-dark .monaco-diff-editor .diffViewport {
|
|
1409
|
+
background: color-mix(in srgb, var(--stream-monaco-editor-fg) 24%, transparent);
|
|
1410
|
+
box-shadow:
|
|
1411
|
+
inset 0 1px 0 rgb(255 255 255 / 0.08),
|
|
1412
|
+
0 10px 18px -14px rgb(2 6 23 / 0.92);
|
|
1413
|
+
}
|
|
1414
|
+
.stream-monaco-diff-root .monaco-diff-editor .diffViewport:hover {
|
|
1415
|
+
background: color-mix(in srgb, var(--stream-monaco-editor-fg) 24%, transparent);
|
|
1416
|
+
}
|
|
1417
|
+
.stream-monaco-diff-root.stream-monaco-diff-appearance-dark .monaco-diff-editor .diffViewport:hover {
|
|
1418
|
+
background: color-mix(in srgb, var(--stream-monaco-editor-fg) 31%, transparent);
|
|
1419
|
+
}
|
|
1420
|
+
.stream-monaco-diff-root .monaco-diff-editor .diffViewport:active {
|
|
1421
|
+
background: color-mix(in srgb, var(--stream-monaco-editor-fg) 32%, transparent);
|
|
1422
|
+
}
|
|
1423
|
+
.stream-monaco-diff-root.stream-monaco-diff-appearance-dark .monaco-diff-editor .diffViewport:active {
|
|
1424
|
+
background: color-mix(in srgb, var(--stream-monaco-editor-fg) 38%, transparent);
|
|
1425
|
+
}
|
|
1426
|
+
.stream-monaco-diff-root .monaco-scrollable-element.modified-in-monaco-diff-editor .slider {
|
|
1427
|
+
border-radius: 999px;
|
|
1428
|
+
}
|
|
1429
|
+
.stream-monaco-diff-root .monaco-editor .line-numbers {
|
|
1430
|
+
color: var(--stream-monaco-line-number) !important;
|
|
1431
|
+
left: var(--stream-monaco-line-number-left) !important;
|
|
1432
|
+
width: var(--stream-monaco-line-number-width) !important;
|
|
1433
|
+
text-align: var(--stream-monaco-line-number-align) !important;
|
|
1434
|
+
}
|
|
1435
|
+
.stream-monaco-diff-root .monaco-editor .line-numbers.active-line-number {
|
|
1436
|
+
color: var(--stream-monaco-line-number-active) !important;
|
|
1437
|
+
}
|
|
1438
|
+
.stream-monaco-diff-root .monaco-editor .line-delete.line-numbers,
|
|
1439
|
+
.stream-monaco-diff-root .monaco-diff-editor .line-delete.line-numbers {
|
|
1440
|
+
color: var(--stream-monaco-removed-fg) !important;
|
|
1441
|
+
}
|
|
1442
|
+
.stream-monaco-diff-root .monaco-editor .line-insert.line-numbers,
|
|
1443
|
+
.stream-monaco-diff-root .monaco-diff-editor .line-insert.line-numbers {
|
|
1444
|
+
color: var(--stream-monaco-added-fg) !important;
|
|
1445
|
+
}
|
|
1446
|
+
.stream-monaco-diff-root .monaco-diff-editor .editor.original .margin,
|
|
1447
|
+
.stream-monaco-diff-root .monaco-diff-editor .editor.original .margin-view-overlays,
|
|
1448
|
+
.stream-monaco-diff-root .monaco-diff-editor .editor.original .margin-view-zones {
|
|
1449
|
+
width: var(--stream-monaco-original-margin-width, auto) !important;
|
|
1450
|
+
}
|
|
1451
|
+
.stream-monaco-diff-root .monaco-diff-editor .editor.original .current-line {
|
|
1452
|
+
width: var(--stream-monaco-original-margin-width, auto) !important;
|
|
1453
|
+
}
|
|
1454
|
+
.stream-monaco-diff-root .monaco-diff-editor .editor.original .monaco-scrollable-element.editor-scrollable {
|
|
1455
|
+
left: var(--stream-monaco-original-scrollable-left, auto) !important;
|
|
1456
|
+
width: var(--stream-monaco-original-scrollable-width, auto) !important;
|
|
1457
|
+
}
|
|
1458
|
+
.stream-monaco-diff-root .monaco-diff-editor .editor.modified .margin,
|
|
1459
|
+
.stream-monaco-diff-root .monaco-diff-editor .editor.modified .margin-view-overlays,
|
|
1460
|
+
.stream-monaco-diff-root .monaco-diff-editor .editor.modified .margin-view-zones {
|
|
1461
|
+
width: var(--stream-monaco-modified-margin-width) !important;
|
|
1462
|
+
}
|
|
1463
|
+
.stream-monaco-diff-root .monaco-diff-editor .editor.modified .current-line {
|
|
1464
|
+
width: var(--stream-monaco-modified-margin-width) !important;
|
|
1465
|
+
}
|
|
1466
|
+
.stream-monaco-diff-root .monaco-diff-editor .editor.modified .monaco-scrollable-element.editor-scrollable {
|
|
1467
|
+
left: var(--stream-monaco-modified-scrollable-left, var(--stream-monaco-modified-margin-width)) !important;
|
|
1468
|
+
width: var(
|
|
1469
|
+
--stream-monaco-modified-scrollable-width,
|
|
1470
|
+
calc(100% - var(--stream-monaco-modified-margin-width))
|
|
1471
|
+
) !important;
|
|
1472
|
+
}
|
|
1473
|
+
.stream-monaco-diff-root .monaco-editor .diagonal-fill {
|
|
1474
|
+
opacity: 0.38;
|
|
1475
|
+
background-size: 10px 10px;
|
|
682
1476
|
}
|
|
683
1477
|
.stream-monaco-diff-root .monaco-editor .diff-hidden-lines-widget {
|
|
684
1478
|
pointer-events: auto;
|
|
685
1479
|
box-sizing: border-box;
|
|
686
1480
|
}
|
|
1481
|
+
.stream-monaco-diff-root.stream-monaco-diff-inline .monaco-diff-editor .editor.original .diff-hidden-lines-widget,
|
|
1482
|
+
.stream-monaco-diff-root.stream-monaco-diff-inline .monaco-diff-editor .editor.original .fold-unchanged {
|
|
1483
|
+
display: none !important;
|
|
1484
|
+
}
|
|
1485
|
+
.stream-monaco-diff-root.stream-monaco-diff-inline .monaco-diff-editor .editor.original .diff-hidden-lines {
|
|
1486
|
+
display: none !important;
|
|
1487
|
+
}
|
|
1488
|
+
.stream-monaco-diff-root.stream-monaco-diff-inline .monaco-diff-editor .editor.original {
|
|
1489
|
+
width: 0 !important;
|
|
1490
|
+
min-width: 0 !important;
|
|
1491
|
+
flex: 0 0 0 !important;
|
|
1492
|
+
border: 0 !important;
|
|
1493
|
+
overflow: hidden !important;
|
|
1494
|
+
}
|
|
1495
|
+
.stream-monaco-diff-root.stream-monaco-diff-inline .monaco-diff-editor .editor.original .monaco-scrollable-element.editor-scrollable {
|
|
1496
|
+
left: 0 !important;
|
|
1497
|
+
width: 0 !important;
|
|
1498
|
+
}
|
|
1499
|
+
.stream-monaco-diff-root.stream-monaco-diff-inline .monaco-diff-editor .editor.modified {
|
|
1500
|
+
left: 0 !important;
|
|
1501
|
+
width: 100% !important;
|
|
1502
|
+
border-left: 0 !important;
|
|
1503
|
+
}
|
|
1504
|
+
.stream-monaco-diff-root.stream-monaco-diff-inline .monaco-diff-editor .editor.original .gutter-delete,
|
|
1505
|
+
.stream-monaco-diff-root.stream-monaco-diff-inline .monaco-diff-editor .editor.original .gutter-insert,
|
|
1506
|
+
.stream-monaco-diff-root.stream-monaco-diff-inline .monaco-diff-editor .editor.original .line-delete,
|
|
1507
|
+
.stream-monaco-diff-root.stream-monaco-diff-inline .monaco-diff-editor .editor.original .line-insert,
|
|
1508
|
+
.stream-monaco-diff-root.stream-monaco-diff-inline .monaco-diff-editor .editor.original .line-numbers,
|
|
1509
|
+
.stream-monaco-diff-root.stream-monaco-diff-inline .monaco-diff-editor .editor.original .diagonal-fill {
|
|
1510
|
+
opacity: 0 !important;
|
|
1511
|
+
background: transparent !important;
|
|
1512
|
+
box-shadow: none !important;
|
|
1513
|
+
pointer-events: none !important;
|
|
1514
|
+
}
|
|
687
1515
|
.stream-monaco-diff-root .monaco-editor .diff-hidden-lines {
|
|
688
1516
|
height: auto;
|
|
689
1517
|
width: 100%;
|
|
690
|
-
transform:
|
|
691
|
-
padding:
|
|
1518
|
+
transform: none;
|
|
1519
|
+
padding: 0 8px;
|
|
692
1520
|
box-sizing: border-box;
|
|
693
1521
|
}
|
|
1522
|
+
.stream-monaco-diff-root.stream-monaco-diff-inline .monaco-editor .diff-hidden-lines-widget {
|
|
1523
|
+
height: 24px !important;
|
|
1524
|
+
}
|
|
1525
|
+
.stream-monaco-diff-root.stream-monaco-diff-inline .monaco-editor .diff-hidden-lines {
|
|
1526
|
+
height: 24px;
|
|
1527
|
+
padding: 0 8px;
|
|
1528
|
+
}
|
|
694
1529
|
.stream-monaco-diff-root .monaco-editor .diff-hidden-lines .top,
|
|
695
1530
|
.stream-monaco-diff-root .monaco-editor .diff-hidden-lines .bottom {
|
|
696
1531
|
display: none !important;
|
|
@@ -698,18 +1533,30 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
698
1533
|
}
|
|
699
1534
|
.stream-monaco-diff-root .monaco-editor .diff-hidden-lines .center {
|
|
700
1535
|
align-items: center;
|
|
701
|
-
gap:
|
|
702
|
-
max-width: calc(100% -
|
|
1536
|
+
gap: 0;
|
|
1537
|
+
max-width: calc(100% - 4px);
|
|
703
1538
|
min-height: 32px;
|
|
704
1539
|
margin: 0 auto;
|
|
705
|
-
padding:
|
|
706
|
-
border-radius:
|
|
707
|
-
border: 1px solid var(--stream-monaco-
|
|
708
|
-
background:
|
|
709
|
-
|
|
1540
|
+
padding: 0;
|
|
1541
|
+
border-radius: 12px;
|
|
1542
|
+
border: 1px solid color-mix(in srgb, var(--stream-monaco-editor-fg) 8%, transparent);
|
|
1543
|
+
background: color-mix(
|
|
1544
|
+
in srgb,
|
|
1545
|
+
var(--stream-monaco-editor-bg) 96%,
|
|
1546
|
+
var(--stream-monaco-editor-fg) 4%
|
|
1547
|
+
);
|
|
1548
|
+
box-shadow: 0 18px 28px -28px var(--stream-monaco-widget-shadow);
|
|
710
1549
|
box-sizing: border-box;
|
|
711
1550
|
overflow: hidden;
|
|
712
|
-
transition: background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease
|
|
1551
|
+
transition: background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
|
|
1552
|
+
}
|
|
1553
|
+
.stream-monaco-diff-root.stream-monaco-diff-inline .monaco-editor .diff-hidden-lines .center {
|
|
1554
|
+
min-height: 24px;
|
|
1555
|
+
height: 24px;
|
|
1556
|
+
border-radius: 10px;
|
|
1557
|
+
}
|
|
1558
|
+
.stream-monaco-diff-root.stream-monaco-diff-unchanged-style-simple .monaco-editor .diff-hidden-lines .center {
|
|
1559
|
+
min-height: 28px;
|
|
713
1560
|
}
|
|
714
1561
|
.stream-monaco-diff-root .monaco-editor .diff-hidden-lines .center.stream-monaco-clickable {
|
|
715
1562
|
cursor: pointer;
|
|
@@ -726,27 +1573,47 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
726
1573
|
visibility: hidden;
|
|
727
1574
|
}
|
|
728
1575
|
.stream-monaco-diff-root .monaco-editor .diff-hidden-lines .center.stream-monaco-unchanged-merged-secondary {
|
|
729
|
-
padding-left:
|
|
1576
|
+
padding-left: 0;
|
|
1577
|
+
}
|
|
1578
|
+
.stream-monaco-diff-root.stream-monaco-diff-appearance-dark .monaco-editor .diff-hidden-lines .center,
|
|
1579
|
+
.stream-monaco-diff-root.stream-monaco-diff-appearance-dark .stream-monaco-diff-unchanged-bridge {
|
|
1580
|
+
border-color: color-mix(in srgb, var(--stream-monaco-editor-fg) 16%, transparent);
|
|
1581
|
+
background: color-mix(
|
|
1582
|
+
in srgb,
|
|
1583
|
+
var(--stream-monaco-editor-bg) 88%,
|
|
1584
|
+
var(--stream-monaco-editor-fg) 12%
|
|
1585
|
+
);
|
|
1586
|
+
box-shadow: 0 22px 34px -30px rgb(2 6 23 / 0.92);
|
|
730
1587
|
}
|
|
731
1588
|
.stream-monaco-diff-root .monaco-editor .diff-hidden-lines .center:hover,
|
|
732
1589
|
.stream-monaco-diff-root .monaco-editor .diff-hidden-lines .center.stream-monaco-focus-within {
|
|
733
|
-
background:
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
1590
|
+
background: color-mix(
|
|
1591
|
+
in srgb,
|
|
1592
|
+
var(--stream-monaco-editor-bg) 94%,
|
|
1593
|
+
var(--stream-monaco-editor-fg) 6%
|
|
1594
|
+
);
|
|
1595
|
+
border-color: color-mix(in srgb, var(--stream-monaco-editor-fg) 12%, transparent);
|
|
1596
|
+
box-shadow: 0 18px 30px -28px var(--stream-monaco-widget-shadow);
|
|
1597
|
+
}
|
|
1598
|
+
.stream-monaco-diff-root.stream-monaco-diff-appearance-dark .monaco-editor .diff-hidden-lines .center:hover,
|
|
1599
|
+
.stream-monaco-diff-root.stream-monaco-diff-appearance-dark .monaco-editor .diff-hidden-lines .center.stream-monaco-focus-within,
|
|
1600
|
+
.stream-monaco-diff-root.stream-monaco-diff-appearance-dark .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-summary:hover,
|
|
1601
|
+
.stream-monaco-diff-root.stream-monaco-diff-appearance-dark .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-summary:focus-visible,
|
|
1602
|
+
.stream-monaco-diff-root.stream-monaco-diff-appearance-dark .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-summary.stream-monaco-focus-visible {
|
|
1603
|
+
background: color-mix(
|
|
1604
|
+
in srgb,
|
|
1605
|
+
var(--stream-monaco-editor-bg) 82%,
|
|
1606
|
+
var(--stream-monaco-editor-fg) 18%
|
|
1607
|
+
);
|
|
1608
|
+
border-color: color-mix(in srgb, var(--stream-monaco-editor-fg) 22%, transparent);
|
|
1609
|
+
box-shadow: 0 24px 36px -30px rgb(2 6 23 / 0.94);
|
|
737
1610
|
}
|
|
738
1611
|
.stream-monaco-diff-root .monaco-editor .diff-hidden-lines .center.stream-monaco-unchanged-merged-secondary .stream-monaco-unchanged-primary {
|
|
739
1612
|
display: none !important;
|
|
740
1613
|
}
|
|
741
1614
|
.stream-monaco-diff-root .monaco-editor .diff-hidden-lines .center .stream-monaco-unchanged-primary,
|
|
742
1615
|
.stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-primary {
|
|
743
|
-
display:
|
|
744
|
-
align-items: center;
|
|
745
|
-
flex: 0 0 auto;
|
|
746
|
-
width: auto !important;
|
|
747
|
-
min-width: max-content;
|
|
748
|
-
overflow: visible;
|
|
749
|
-
justify-content: flex-start !important;
|
|
1616
|
+
display: none !important;
|
|
750
1617
|
}
|
|
751
1618
|
.stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-primary {
|
|
752
1619
|
width: 100% !important;
|
|
@@ -764,7 +1631,7 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
764
1631
|
border-radius: 999px;
|
|
765
1632
|
text-decoration: none;
|
|
766
1633
|
color: inherit;
|
|
767
|
-
background: color-mix(in srgb, var(--stream-monaco-unchanged-fg)
|
|
1634
|
+
background: color-mix(in srgb, var(--stream-monaco-unchanged-fg) 10%, var(--stream-monaco-editor-bg) 90%);
|
|
768
1635
|
border: 1px solid color-mix(in srgb, var(--stream-monaco-unchanged-fg) 10%, transparent);
|
|
769
1636
|
font-size: 11px;
|
|
770
1637
|
font-weight: 700;
|
|
@@ -787,8 +1654,8 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
787
1654
|
.stream-monaco-diff-root .monaco-editor .diff-hidden-lines .center .stream-monaco-unchanged-expand:hover,
|
|
788
1655
|
.stream-monaco-diff-root .monaco-editor .diff-hidden-lines .center .stream-monaco-unchanged-expand:focus-visible,
|
|
789
1656
|
.stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-expand:hover {
|
|
790
|
-
background: color-mix(in srgb, var(--stream-monaco-unchanged-fg)
|
|
791
|
-
border-color: color-mix(in srgb, var(--stream-monaco-unchanged-fg)
|
|
1657
|
+
background: color-mix(in srgb, var(--stream-monaco-unchanged-fg) 14%, var(--stream-monaco-editor-bg) 86%);
|
|
1658
|
+
border-color: color-mix(in srgb, var(--stream-monaco-unchanged-fg) 18%, transparent);
|
|
792
1659
|
transform: translateY(-1px);
|
|
793
1660
|
}
|
|
794
1661
|
.stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-expand:hover {
|
|
@@ -800,28 +1667,38 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
800
1667
|
.stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-meta {
|
|
801
1668
|
display: flex;
|
|
802
1669
|
align-items: center;
|
|
803
|
-
gap:
|
|
1670
|
+
gap: 10px;
|
|
804
1671
|
min-width: 0;
|
|
805
1672
|
flex: 1 1 auto;
|
|
806
1673
|
overflow: hidden;
|
|
807
|
-
color: var(--stream-monaco-
|
|
1674
|
+
color: color-mix(in srgb, var(--stream-monaco-editor-fg) 54%, transparent);
|
|
808
1675
|
white-space: nowrap;
|
|
809
1676
|
}
|
|
1677
|
+
.stream-monaco-diff-root.stream-monaco-diff-appearance-dark .monaco-editor .diff-hidden-lines .center .stream-monaco-unchanged-meta,
|
|
1678
|
+
.stream-monaco-diff-root.stream-monaco-diff-appearance-dark .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-meta {
|
|
1679
|
+
color: color-mix(in srgb, var(--stream-monaco-editor-fg) 78%, transparent);
|
|
1680
|
+
}
|
|
810
1681
|
.stream-monaco-diff-root .monaco-editor .diff-hidden-lines .center.stream-monaco-unchanged-merged-secondary .stream-monaco-unchanged-meta {
|
|
811
|
-
justify-content:
|
|
1682
|
+
justify-content: flex-start;
|
|
812
1683
|
}
|
|
813
1684
|
.stream-monaco-diff-root .monaco-editor .diff-hidden-lines .center .stream-monaco-unchanged-count,
|
|
814
1685
|
.stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-count {
|
|
815
1686
|
display: inline-flex;
|
|
816
1687
|
align-items: center;
|
|
817
1688
|
flex: 0 0 auto;
|
|
818
|
-
padding:
|
|
819
|
-
border-radius:
|
|
820
|
-
background:
|
|
821
|
-
color: var(--stream-monaco-
|
|
822
|
-
font-size:
|
|
823
|
-
|
|
824
|
-
|
|
1689
|
+
padding: 0;
|
|
1690
|
+
border-radius: 0;
|
|
1691
|
+
background: transparent;
|
|
1692
|
+
color: color-mix(in srgb, var(--stream-monaco-editor-fg) 58%, transparent);
|
|
1693
|
+
font-size: 13px;
|
|
1694
|
+
line-height: 14px;
|
|
1695
|
+
font-weight: 500;
|
|
1696
|
+
letter-spacing: 0;
|
|
1697
|
+
}
|
|
1698
|
+
.stream-monaco-diff-root.stream-monaco-diff-appearance-dark .monaco-editor .diff-hidden-lines .center .stream-monaco-unchanged-count,
|
|
1699
|
+
.stream-monaco-diff-root.stream-monaco-diff-appearance-dark .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-count {
|
|
1700
|
+
color: color-mix(in srgb, var(--stream-monaco-editor-fg) 92%, transparent);
|
|
1701
|
+
font-weight: 600;
|
|
825
1702
|
}
|
|
826
1703
|
.stream-monaco-diff-root .monaco-editor .diff-hidden-lines .center .stream-monaco-unchanged-separator {
|
|
827
1704
|
flex: 0 0 auto;
|
|
@@ -851,49 +1728,341 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
851
1728
|
.stream-monaco-diff-root .monaco-editor .diff-hidden-lines .center.stream-monaco-unchanged-merged-secondary .stream-monaco-unchanged-breadcrumb {
|
|
852
1729
|
display: none;
|
|
853
1730
|
}
|
|
1731
|
+
.stream-monaco-diff-root .monaco-editor .diff-hidden-lines .center .stream-monaco-unchanged-meta {
|
|
1732
|
+
justify-content: flex-start;
|
|
1733
|
+
padding: 0 18px 0 16px;
|
|
1734
|
+
}
|
|
1735
|
+
.stream-monaco-diff-root.stream-monaco-diff-unchanged-style-metadata .monaco-editor .diff-hidden-lines .center .stream-monaco-unchanged-meta {
|
|
1736
|
+
padding: 0 28px;
|
|
1737
|
+
}
|
|
1738
|
+
.stream-monaco-diff-root.stream-monaco-diff-unchanged-style-simple .monaco-editor .diff-hidden-lines .center .stream-monaco-unchanged-meta {
|
|
1739
|
+
justify-content: center;
|
|
1740
|
+
padding: 0 10px;
|
|
1741
|
+
}
|
|
1742
|
+
.stream-monaco-diff-root .monaco-editor .diff-hidden-lines .center .stream-monaco-unchanged-separator,
|
|
1743
|
+
.stream-monaco-diff-root .monaco-editor .diff-hidden-lines .center .stream-monaco-unchanged-breadcrumb,
|
|
1744
|
+
.stream-monaco-diff-root .monaco-editor .diff-hidden-lines .center .stream-monaco-unchanged-expand {
|
|
1745
|
+
display: none !important;
|
|
1746
|
+
}
|
|
854
1747
|
.stream-monaco-diff-root .stream-monaco-diff-unchanged-overlay {
|
|
855
1748
|
position: absolute;
|
|
856
1749
|
inset: 0;
|
|
857
1750
|
pointer-events: none;
|
|
858
1751
|
z-index: 12;
|
|
859
1752
|
}
|
|
1753
|
+
.stream-monaco-diff-root.stream-monaco-diff-inline .stream-monaco-diff-unchanged-overlay {
|
|
1754
|
+
display: none !important;
|
|
1755
|
+
}
|
|
1756
|
+
.stream-monaco-diff-root .stream-monaco-diff-unchanged-overlay [hidden] {
|
|
1757
|
+
display: none !important;
|
|
1758
|
+
}
|
|
860
1759
|
.stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge {
|
|
861
1760
|
position: absolute;
|
|
862
1761
|
display: grid;
|
|
863
|
-
grid-template-columns:
|
|
1762
|
+
grid-template-columns: var(--stream-monaco-unchanged-rail-width, 54px) minmax(0, 1fr);
|
|
864
1763
|
align-items: center;
|
|
865
|
-
column-gap:
|
|
1764
|
+
column-gap: 0;
|
|
866
1765
|
min-height: 32px;
|
|
867
|
-
padding:
|
|
868
|
-
border-radius:
|
|
869
|
-
border: 1px solid color-mix(in srgb, var(--stream-monaco-
|
|
870
|
-
background:
|
|
871
|
-
|
|
1766
|
+
padding: 0;
|
|
1767
|
+
border-radius: 12px;
|
|
1768
|
+
border: 1px solid color-mix(in srgb, var(--stream-monaco-editor-fg) 8%, transparent);
|
|
1769
|
+
background: color-mix(
|
|
1770
|
+
in srgb,
|
|
1771
|
+
var(--stream-monaco-editor-bg) 96%,
|
|
1772
|
+
var(--stream-monaco-editor-fg) 4%
|
|
1773
|
+
);
|
|
1774
|
+
box-shadow: 0 18px 28px -28px var(--stream-monaco-widget-shadow);
|
|
872
1775
|
box-sizing: border-box;
|
|
873
1776
|
overflow: hidden;
|
|
874
1777
|
pointer-events: auto;
|
|
875
|
-
transition: background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease
|
|
1778
|
+
transition: background-color 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
|
|
876
1779
|
}
|
|
877
|
-
.stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
1780
|
+
.stream-monaco-diff-root.stream-monaco-diff-side-by-side .stream-monaco-diff-unchanged-bridge {
|
|
1781
|
+
min-height: 24px;
|
|
1782
|
+
border-radius: 10px;
|
|
1783
|
+
}
|
|
1784
|
+
.stream-monaco-diff-root.stream-monaco-diff-appearance-dark .stream-monaco-diff-unchanged-bridge:not(.stream-monaco-diff-unchanged-bridge-metadata):not(.stream-monaco-diff-unchanged-bridge-simple) {
|
|
1785
|
+
border-color: color-mix(in srgb, var(--stream-monaco-editor-fg) 18%, transparent);
|
|
1786
|
+
background:
|
|
1787
|
+
linear-gradient(
|
|
1788
|
+
180deg,
|
|
1789
|
+
color-mix(in srgb, var(--stream-monaco-editor-bg) 84%, var(--stream-monaco-editor-fg) 16%) 0%,
|
|
1790
|
+
color-mix(in srgb, var(--stream-monaco-editor-bg) 88%, var(--stream-monaco-editor-fg) 12%) 100%
|
|
1791
|
+
);
|
|
1792
|
+
box-shadow:
|
|
1793
|
+
inset 0 1px 0 rgb(255 255 255 / 0.03),
|
|
1794
|
+
0 22px 34px -30px rgb(2 6 23 / 0.92);
|
|
1795
|
+
}
|
|
1796
|
+
.stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge.stream-monaco-diff-unchanged-bridge-metadata {
|
|
1797
|
+
grid-template-columns: minmax(0, 1fr);
|
|
1798
|
+
min-height: 32px;
|
|
1799
|
+
border-radius: 0;
|
|
1800
|
+
border-left: 0;
|
|
1801
|
+
border-right: 0;
|
|
1802
|
+
box-shadow: none;
|
|
1803
|
+
}
|
|
1804
|
+
.stream-monaco-diff-root.stream-monaco-diff-appearance-dark .stream-monaco-diff-unchanged-bridge.stream-monaco-diff-unchanged-bridge-metadata {
|
|
1805
|
+
border-top: 1px solid color-mix(in srgb, var(--stream-monaco-editor-fg) 14%, transparent);
|
|
1806
|
+
border-bottom: 1px solid color-mix(in srgb, var(--stream-monaco-editor-fg) 14%, transparent);
|
|
1807
|
+
background: color-mix(
|
|
1808
|
+
in srgb,
|
|
1809
|
+
var(--stream-monaco-editor-bg) 92%,
|
|
1810
|
+
var(--stream-monaco-editor-fg) 8%
|
|
1811
|
+
);
|
|
1812
|
+
box-shadow:
|
|
1813
|
+
inset 0 1px 0 rgb(255 255 255 / 0.02),
|
|
1814
|
+
inset 0 -1px 0 rgb(15 23 42 / 0.22);
|
|
1815
|
+
}
|
|
1816
|
+
.stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge.stream-monaco-diff-unchanged-bridge-simple {
|
|
1817
|
+
grid-template-columns: minmax(0, 1fr);
|
|
1818
|
+
min-height: 28px;
|
|
1819
|
+
border: 0;
|
|
1820
|
+
border-radius: 0;
|
|
1821
|
+
background: transparent;
|
|
1822
|
+
box-shadow: none;
|
|
1823
|
+
}
|
|
1824
|
+
.stream-monaco-diff-root.stream-monaco-diff-appearance-dark .stream-monaco-diff-unchanged-bridge.stream-monaco-diff-unchanged-bridge-simple {
|
|
1825
|
+
background: transparent;
|
|
883
1826
|
}
|
|
884
1827
|
.stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge:focus {
|
|
885
1828
|
outline: none;
|
|
886
1829
|
}
|
|
887
|
-
.stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-
|
|
888
|
-
|
|
1830
|
+
.stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-rail {
|
|
1831
|
+
display: grid;
|
|
1832
|
+
grid-auto-rows: minmax(0, 1fr);
|
|
1833
|
+
align-self: stretch;
|
|
1834
|
+
min-height: 100%;
|
|
1835
|
+
border-right: 1px solid color-mix(in srgb, var(--stream-monaco-editor-fg) 7%, transparent);
|
|
1836
|
+
background: color-mix(
|
|
1837
|
+
in srgb,
|
|
1838
|
+
var(--stream-monaco-editor-bg) 94%,
|
|
1839
|
+
var(--stream-monaco-editor-fg) 6%
|
|
1840
|
+
);
|
|
1841
|
+
z-index: 1;
|
|
1842
|
+
}
|
|
1843
|
+
.stream-monaco-diff-root.stream-monaco-diff-appearance-dark .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-rail {
|
|
1844
|
+
border-right-color: color-mix(in srgb, var(--stream-monaco-editor-fg) 12%, transparent);
|
|
1845
|
+
background:
|
|
1846
|
+
linear-gradient(
|
|
1847
|
+
180deg,
|
|
1848
|
+
color-mix(in srgb, var(--stream-monaco-editor-bg) 82%, var(--stream-monaco-editor-fg) 18%) 0%,
|
|
1849
|
+
color-mix(in srgb, var(--stream-monaco-editor-bg) 88%, var(--stream-monaco-editor-fg) 12%) 100%
|
|
1850
|
+
);
|
|
1851
|
+
box-shadow:
|
|
1852
|
+
inset 0 1px 0 rgb(255 255 255 / 0.04),
|
|
1853
|
+
inset -1px 0 0 rgb(15 23 42 / 0.22);
|
|
1854
|
+
}
|
|
1855
|
+
.stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge.stream-monaco-diff-unchanged-bridge-line-info .stream-monaco-unchanged-rail {
|
|
1856
|
+
justify-items: stretch;
|
|
1857
|
+
border-right: 1px solid color-mix(in srgb, var(--stream-monaco-editor-fg) 8%, transparent);
|
|
1858
|
+
background: color-mix(
|
|
1859
|
+
in srgb,
|
|
1860
|
+
var(--stream-monaco-editor-bg) 92%,
|
|
1861
|
+
var(--stream-monaco-editor-fg) 8%
|
|
1862
|
+
);
|
|
1863
|
+
border-radius: 10px 0 0 10px;
|
|
1864
|
+
overflow: hidden;
|
|
1865
|
+
box-shadow: inset -1px 0 0 color-mix(in srgb, var(--stream-monaco-editor-fg) 6%, transparent);
|
|
1866
|
+
}
|
|
1867
|
+
.stream-monaco-diff-root.stream-monaco-diff-appearance-dark .stream-monaco-diff-unchanged-bridge.stream-monaco-diff-unchanged-bridge-line-info .stream-monaco-unchanged-rail {
|
|
1868
|
+
border-right-color: color-mix(in srgb, var(--stream-monaco-editor-fg) 14%, transparent);
|
|
1869
|
+
background: color-mix(
|
|
1870
|
+
in srgb,
|
|
1871
|
+
var(--stream-monaco-editor-bg) 80%,
|
|
1872
|
+
var(--stream-monaco-editor-fg) 20%
|
|
1873
|
+
);
|
|
1874
|
+
box-shadow:
|
|
1875
|
+
inset 0 1px 0 rgb(255 255 255 / 0.04),
|
|
1876
|
+
inset -1px 0 0 rgb(15 23 42 / 0.24);
|
|
1877
|
+
}
|
|
1878
|
+
.stream-monaco-diff-root.stream-monaco-diff-appearance-dark .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-reveal {
|
|
1879
|
+
border-bottom-color: color-mix(in srgb, var(--stream-monaco-editor-fg) 12%, transparent);
|
|
1880
|
+
color: color-mix(in srgb, var(--stream-monaco-editor-fg) 68%, transparent);
|
|
1881
|
+
}
|
|
1882
|
+
.stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-reveal {
|
|
1883
|
+
appearance: none;
|
|
1884
|
+
display: inline-flex;
|
|
1885
|
+
align-items: center;
|
|
889
1886
|
justify-content: center;
|
|
1887
|
+
width: 100%;
|
|
1888
|
+
min-height: 15px;
|
|
1889
|
+
padding: 0;
|
|
1890
|
+
border: 0;
|
|
1891
|
+
border-bottom: 1px solid color-mix(in srgb, var(--stream-monaco-editor-fg) 7%, transparent);
|
|
1892
|
+
background: transparent;
|
|
1893
|
+
color: color-mix(in srgb, var(--stream-monaco-editor-fg) 54%, transparent);
|
|
1894
|
+
cursor: pointer;
|
|
1895
|
+
font: inherit;
|
|
1896
|
+
transition: background-color 0.14s ease, color 0.14s ease;
|
|
890
1897
|
}
|
|
891
|
-
.stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-
|
|
892
|
-
display: block;
|
|
893
|
-
visibility: hidden;
|
|
1898
|
+
.stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge.stream-monaco-diff-unchanged-bridge-line-info .stream-monaco-unchanged-reveal {
|
|
894
1899
|
width: 100%;
|
|
895
|
-
|
|
896
|
-
|
|
1900
|
+
min-width: 100%;
|
|
1901
|
+
margin-left: 0;
|
|
1902
|
+
border-bottom-color: color-mix(in srgb, var(--stream-monaco-editor-fg) 8%, transparent);
|
|
1903
|
+
background: transparent;
|
|
1904
|
+
}
|
|
1905
|
+
.stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge.stream-monaco-diff-unchanged-bridge-line-info .stream-monaco-unchanged-reveal:first-child {
|
|
1906
|
+
border-radius: 10px 0 0 0;
|
|
1907
|
+
}
|
|
1908
|
+
.stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge.stream-monaco-diff-unchanged-bridge-line-info .stream-monaco-unchanged-reveal:last-child {
|
|
1909
|
+
border-radius: 0 0 0 10px;
|
|
1910
|
+
}
|
|
1911
|
+
.stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge.stream-monaco-diff-unchanged-bridge-line-info .stream-monaco-unchanged-reveal:first-child:last-child {
|
|
1912
|
+
border-radius: 10px 0 0 10px;
|
|
1913
|
+
}
|
|
1914
|
+
.stream-monaco-diff-root.stream-monaco-diff-side-by-side .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-reveal {
|
|
1915
|
+
min-height: 12px;
|
|
1916
|
+
}
|
|
1917
|
+
.stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-reveal .codicon {
|
|
1918
|
+
font-size: 18px;
|
|
1919
|
+
line-height: 1;
|
|
1920
|
+
}
|
|
1921
|
+
.stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-reveal:last-child {
|
|
1922
|
+
border-bottom: 0;
|
|
1923
|
+
}
|
|
1924
|
+
.stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-reveal:hover,
|
|
1925
|
+
.stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-reveal:focus-visible,
|
|
1926
|
+
.stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-reveal.stream-monaco-focus-visible {
|
|
1927
|
+
background: color-mix(in srgb, var(--stream-monaco-editor-bg) 88%, var(--stream-monaco-editor-fg) 12%);
|
|
1928
|
+
color: color-mix(in srgb, var(--stream-monaco-editor-fg) 68%, transparent);
|
|
1929
|
+
}
|
|
1930
|
+
.stream-monaco-diff-root.stream-monaco-diff-appearance-dark .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-reveal:hover,
|
|
1931
|
+
.stream-monaco-diff-root.stream-monaco-diff-appearance-dark .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-reveal:focus-visible,
|
|
1932
|
+
.stream-monaco-diff-root.stream-monaco-diff-appearance-dark .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-reveal.stream-monaco-focus-visible {
|
|
1933
|
+
background: color-mix(in srgb, var(--stream-monaco-editor-bg) 74%, var(--stream-monaco-editor-fg) 26%);
|
|
1934
|
+
color: color-mix(in srgb, var(--stream-monaco-editor-fg) 90%, transparent);
|
|
1935
|
+
box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.06);
|
|
1936
|
+
}
|
|
1937
|
+
.stream-monaco-diff-root.stream-monaco-diff-appearance-dark .stream-monaco-diff-unchanged-bridge.stream-monaco-diff-unchanged-bridge-line-info .stream-monaco-unchanged-reveal {
|
|
1938
|
+
border-bottom-color: color-mix(in srgb, var(--stream-monaco-editor-fg) 14%, transparent);
|
|
1939
|
+
background: transparent;
|
|
1940
|
+
}
|
|
1941
|
+
.stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-summary {
|
|
1942
|
+
appearance: none;
|
|
1943
|
+
display: flex;
|
|
1944
|
+
align-items: center;
|
|
1945
|
+
justify-content: flex-start;
|
|
1946
|
+
min-width: 0;
|
|
1947
|
+
min-height: 30px;
|
|
1948
|
+
padding: 0 18px 0 16px;
|
|
1949
|
+
border: 0;
|
|
1950
|
+
background: transparent;
|
|
1951
|
+
box-sizing: border-box;
|
|
1952
|
+
color: inherit;
|
|
1953
|
+
text-align: left;
|
|
1954
|
+
cursor: pointer;
|
|
1955
|
+
font: inherit;
|
|
1956
|
+
z-index: 1;
|
|
1957
|
+
transition: background-color 0.14s ease;
|
|
1958
|
+
}
|
|
1959
|
+
.stream-monaco-diff-root.stream-monaco-diff-side-by-side .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-summary {
|
|
1960
|
+
min-height: 22px;
|
|
1961
|
+
}
|
|
1962
|
+
.stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-summary.stream-monaco-unchanged-summary-metadata {
|
|
1963
|
+
min-height: 30px;
|
|
1964
|
+
padding: 0 28px;
|
|
1965
|
+
cursor: default;
|
|
1966
|
+
pointer-events: none;
|
|
1967
|
+
}
|
|
1968
|
+
.stream-monaco-diff-root.stream-monaco-diff-side-by-side .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-summary.stream-monaco-unchanged-summary-metadata {
|
|
1969
|
+
min-height: 22px;
|
|
1970
|
+
}
|
|
1971
|
+
.stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-summary.stream-monaco-unchanged-summary-simple {
|
|
1972
|
+
justify-content: center;
|
|
1973
|
+
min-height: 28px;
|
|
1974
|
+
padding: 0 10px;
|
|
1975
|
+
cursor: default;
|
|
1976
|
+
pointer-events: none;
|
|
1977
|
+
}
|
|
1978
|
+
.stream-monaco-diff-root.stream-monaco-diff-side-by-side .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-summary.stream-monaco-unchanged-summary-simple {
|
|
1979
|
+
min-height: 22px;
|
|
1980
|
+
}
|
|
1981
|
+
.stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-summary:hover,
|
|
1982
|
+
.stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-summary:focus-visible,
|
|
1983
|
+
.stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-summary.stream-monaco-focus-visible {
|
|
1984
|
+
background: color-mix(in srgb, var(--stream-monaco-editor-bg) 91%, var(--stream-monaco-editor-fg) 9%);
|
|
1985
|
+
}
|
|
1986
|
+
.stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge.stream-monaco-diff-unchanged-bridge-simple .stream-monaco-unchanged-summary:hover,
|
|
1987
|
+
.stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge.stream-monaco-diff-unchanged-bridge-simple .stream-monaco-unchanged-summary:focus-visible,
|
|
1988
|
+
.stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge.stream-monaco-diff-unchanged-bridge-simple .stream-monaco-unchanged-summary.stream-monaco-focus-visible {
|
|
1989
|
+
background: transparent;
|
|
1990
|
+
}
|
|
1991
|
+
.stream-monaco-diff-root.stream-monaco-diff-appearance-dark .stream-monaco-diff-unchanged-bridge.stream-monaco-diff-unchanged-bridge-simple .stream-monaco-unchanged-summary:hover,
|
|
1992
|
+
.stream-monaco-diff-root.stream-monaco-diff-appearance-dark .stream-monaco-diff-unchanged-bridge.stream-monaco-diff-unchanged-bridge-simple .stream-monaco-unchanged-summary:focus-visible,
|
|
1993
|
+
.stream-monaco-diff-root.stream-monaco-diff-appearance-dark .stream-monaco-diff-unchanged-bridge.stream-monaco-diff-unchanged-bridge-simple .stream-monaco-unchanged-summary.stream-monaco-focus-visible {
|
|
1994
|
+
background: color-mix(in srgb, var(--stream-monaco-editor-bg) 96%, transparent);
|
|
1995
|
+
}
|
|
1996
|
+
.stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge.stream-monaco-diff-unchanged-bridge-metadata .stream-monaco-unchanged-summary:hover,
|
|
1997
|
+
.stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge.stream-monaco-diff-unchanged-bridge-metadata .stream-monaco-unchanged-summary:focus-visible,
|
|
1998
|
+
.stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge.stream-monaco-diff-unchanged-bridge-metadata .stream-monaco-unchanged-summary.stream-monaco-focus-visible {
|
|
1999
|
+
background: transparent;
|
|
2000
|
+
}
|
|
2001
|
+
.stream-monaco-diff-root.stream-monaco-diff-appearance-dark .stream-monaco-diff-unchanged-bridge.stream-monaco-diff-unchanged-bridge-metadata .stream-monaco-unchanged-summary:hover,
|
|
2002
|
+
.stream-monaco-diff-root.stream-monaco-diff-appearance-dark .stream-monaco-diff-unchanged-bridge.stream-monaco-diff-unchanged-bridge-metadata .stream-monaco-unchanged-summary:focus-visible,
|
|
2003
|
+
.stream-monaco-diff-root.stream-monaco-diff-appearance-dark .stream-monaco-diff-unchanged-bridge.stream-monaco-diff-unchanged-bridge-metadata .stream-monaco-unchanged-summary.stream-monaco-focus-visible {
|
|
2004
|
+
background: transparent;
|
|
2005
|
+
box-shadow: none;
|
|
2006
|
+
}
|
|
2007
|
+
.stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-meta {
|
|
2008
|
+
justify-self: stretch;
|
|
2009
|
+
justify-content: flex-start;
|
|
2010
|
+
}
|
|
2011
|
+
.stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-meta.stream-monaco-unchanged-meta-simple {
|
|
2012
|
+
justify-content: center;
|
|
2013
|
+
}
|
|
2014
|
+
.stream-monaco-diff-root .monaco-editor .diff-hidden-lines .center .stream-monaco-unchanged-metadata-label,
|
|
2015
|
+
.stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-metadata-label {
|
|
2016
|
+
display: inline-flex;
|
|
2017
|
+
align-items: center;
|
|
2018
|
+
min-width: 0;
|
|
2019
|
+
color: color-mix(in srgb, var(--stream-monaco-editor-fg) 60%, transparent);
|
|
2020
|
+
font-size: 13px;
|
|
2021
|
+
line-height: 14px;
|
|
2022
|
+
font-weight: 500;
|
|
2023
|
+
letter-spacing: 0.01em;
|
|
2024
|
+
}
|
|
2025
|
+
.stream-monaco-diff-root.stream-monaco-diff-appearance-dark .monaco-editor .diff-hidden-lines .center .stream-monaco-unchanged-metadata-label,
|
|
2026
|
+
.stream-monaco-diff-root.stream-monaco-diff-appearance-dark .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-metadata-label {
|
|
2027
|
+
color: color-mix(in srgb, var(--stream-monaco-editor-fg) 88%, transparent);
|
|
2028
|
+
font-weight: 550;
|
|
2029
|
+
}
|
|
2030
|
+
.stream-monaco-diff-root .monaco-editor .diff-hidden-lines .center .stream-monaco-unchanged-simple-bar,
|
|
2031
|
+
.stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-simple-bar {
|
|
2032
|
+
width: min(100%, calc(100% - 20px));
|
|
2033
|
+
height: 10px;
|
|
2034
|
+
border-radius: 999px;
|
|
2035
|
+
background: color-mix(in srgb, var(--stream-monaco-editor-bg) 88%, var(--stream-monaco-editor-fg) 12%);
|
|
2036
|
+
box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.7);
|
|
2037
|
+
}
|
|
2038
|
+
.stream-monaco-diff-root.stream-monaco-diff-appearance-dark .monaco-editor .diff-hidden-lines .center .stream-monaco-unchanged-simple-bar,
|
|
2039
|
+
.stream-monaco-diff-root.stream-monaco-diff-appearance-dark .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-simple-bar {
|
|
2040
|
+
height: 9px;
|
|
2041
|
+
background: linear-gradient(
|
|
2042
|
+
90deg,
|
|
2043
|
+
color-mix(in srgb, var(--stream-monaco-editor-bg) 78%, var(--stream-monaco-editor-fg) 22%) 0%,
|
|
2044
|
+
color-mix(in srgb, var(--stream-monaco-editor-bg) 72%, var(--stream-monaco-editor-fg) 28%) 100%
|
|
2045
|
+
);
|
|
2046
|
+
box-shadow:
|
|
2047
|
+
inset 0 1px 0 rgb(255 255 255 / 0.04),
|
|
2048
|
+
inset 0 0 0 1px rgb(148 163 184 / 0.06);
|
|
2049
|
+
}
|
|
2050
|
+
.stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-pane-divider {
|
|
2051
|
+
position: absolute;
|
|
2052
|
+
top: 0;
|
|
2053
|
+
bottom: 0;
|
|
2054
|
+
left: var(--stream-monaco-unchanged-split-offset, 50%);
|
|
2055
|
+
width: 1px;
|
|
2056
|
+
background: color-mix(in srgb, var(--stream-monaco-editor-fg) 7%, transparent);
|
|
2057
|
+
pointer-events: none;
|
|
2058
|
+
transform: translateX(-0.5px);
|
|
2059
|
+
}
|
|
2060
|
+
.stream-monaco-diff-root.stream-monaco-diff-appearance-dark .stream-monaco-diff-unchanged-bridge .stream-monaco-unchanged-pane-divider {
|
|
2061
|
+
background: color-mix(in srgb, var(--stream-monaco-editor-fg) 12%, transparent);
|
|
2062
|
+
}
|
|
2063
|
+
.stream-monaco-diff-root .stream-monaco-diff-unchanged-bridge.stream-monaco-diff-unchanged-bridge-simple .stream-monaco-unchanged-pane-divider {
|
|
2064
|
+
top: 8px;
|
|
2065
|
+
bottom: 8px;
|
|
897
2066
|
}
|
|
898
2067
|
.stream-monaco-diff-root .monaco-editor .diff-hidden-lines-compact {
|
|
899
2068
|
align-items: center;
|
|
@@ -903,7 +2072,7 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
903
2072
|
.stream-monaco-diff-root .monaco-editor .diff-hidden-lines-compact .text {
|
|
904
2073
|
padding: 0 6px;
|
|
905
2074
|
border-radius: 999px;
|
|
906
|
-
background: var(--stream-monaco-
|
|
2075
|
+
background: color-mix(in srgb, var(--stream-monaco-unchanged-fg) 10%, var(--stream-monaco-editor-bg) 90%);
|
|
907
2076
|
color: var(--stream-monaco-unchanged-fg);
|
|
908
2077
|
}
|
|
909
2078
|
.stream-monaco-diff-root .monaco-editor .fold-unchanged {
|
|
@@ -915,10 +2084,10 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
915
2084
|
margin-left: 4px;
|
|
916
2085
|
border-radius: 999px;
|
|
917
2086
|
color: var(--stream-monaco-unchanged-fg);
|
|
918
|
-
background: var(--stream-monaco-surface);
|
|
2087
|
+
background: color-mix(in srgb, var(--stream-monaco-surface) 92%, var(--stream-monaco-editor-bg) 8%);
|
|
919
2088
|
border: 1px solid var(--stream-monaco-border);
|
|
920
|
-
box-shadow: 0
|
|
921
|
-
opacity: 0.
|
|
2089
|
+
box-shadow: 0 12px 20px -18px var(--stream-monaco-widget-shadow);
|
|
2090
|
+
opacity: 0.92 !important;
|
|
922
2091
|
transition: background-color 0.14s ease, border-color 0.14s ease, transform 0.14s ease, opacity 0.14s ease, box-shadow 0.14s ease;
|
|
923
2092
|
}
|
|
924
2093
|
.stream-monaco-diff-root .monaco-editor .fold-unchanged:hover,
|
|
@@ -927,7 +2096,7 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
927
2096
|
transform: translateY(-1px);
|
|
928
2097
|
background: var(--stream-monaco-surface-hover);
|
|
929
2098
|
border-color: var(--stream-monaco-border-strong);
|
|
930
|
-
box-shadow: 0
|
|
2099
|
+
box-shadow: 0 16px 26px -18px var(--stream-monaco-widget-shadow);
|
|
931
2100
|
}
|
|
932
2101
|
.stream-monaco-diff-root .monaco-editor .diff-hidden-lines .center:focus,
|
|
933
2102
|
.stream-monaco-diff-root .monaco-editor .fold-unchanged:focus {
|
|
@@ -946,29 +2115,43 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
946
2115
|
display: none;
|
|
947
2116
|
gap: 6px;
|
|
948
2117
|
pointer-events: auto;
|
|
949
|
-
padding:
|
|
2118
|
+
padding: 6px;
|
|
950
2119
|
border-radius: 999px;
|
|
951
|
-
background: color-mix(in srgb,
|
|
952
|
-
border: 1px solid color-mix(in srgb,
|
|
953
|
-
box-shadow: 0
|
|
2120
|
+
background: color-mix(in srgb, var(--stream-monaco-editor-bg) 80%, var(--stream-monaco-editor-fg) 20%);
|
|
2121
|
+
border: 1px solid color-mix(in srgb, var(--stream-monaco-editor-fg) 12%, transparent);
|
|
2122
|
+
box-shadow: 0 18px 34px -24px var(--stream-monaco-widget-shadow);
|
|
2123
|
+
backdrop-filter: blur(14px);
|
|
954
2124
|
}
|
|
955
2125
|
.stream-monaco-diff-hunk-actions button {
|
|
956
2126
|
appearance: none;
|
|
957
|
-
border:
|
|
2127
|
+
border: 1px solid transparent;
|
|
958
2128
|
border-radius: 999px;
|
|
959
|
-
padding:
|
|
2129
|
+
padding: 4px 10px;
|
|
960
2130
|
font-size: 11px;
|
|
961
2131
|
line-height: 1.35;
|
|
962
|
-
|
|
963
|
-
|
|
2132
|
+
font-weight: 700;
|
|
2133
|
+
background: color-mix(in srgb, var(--stream-monaco-editor-bg) 94%, var(--stream-monaco-editor-fg) 6%);
|
|
2134
|
+
color: var(--stream-monaco-editor-fg);
|
|
964
2135
|
cursor: pointer;
|
|
2136
|
+
transition: background-color 0.14s ease, border-color 0.14s ease, transform 0.14s ease;
|
|
2137
|
+
}
|
|
2138
|
+
.stream-monaco-diff-hunk-actions button[data-action="revert"] {
|
|
2139
|
+
background: color-mix(in srgb, var(--stream-monaco-removed-line) 78%, var(--stream-monaco-editor-bg) 22%);
|
|
2140
|
+
border-color: var(--stream-monaco-removed-border);
|
|
2141
|
+
color: color-mix(in srgb, var(--stream-monaco-removed-fg) 82%, var(--stream-monaco-editor-fg) 18%);
|
|
2142
|
+
}
|
|
2143
|
+
.stream-monaco-diff-hunk-actions button[data-action="stage"] {
|
|
2144
|
+
background: color-mix(in srgb, var(--stream-monaco-added-line) 78%, var(--stream-monaco-editor-bg) 22%);
|
|
2145
|
+
border-color: var(--stream-monaco-added-border);
|
|
2146
|
+
color: color-mix(in srgb, var(--stream-monaco-added-fg) 82%, var(--stream-monaco-editor-fg) 18%);
|
|
965
2147
|
}
|
|
966
2148
|
.stream-monaco-diff-hunk-actions button:hover {
|
|
967
|
-
|
|
2149
|
+
transform: translateY(-1px);
|
|
968
2150
|
}
|
|
969
2151
|
.stream-monaco-diff-hunk-actions button:disabled {
|
|
970
2152
|
opacity: 0.45;
|
|
971
2153
|
cursor: default;
|
|
2154
|
+
transform: none;
|
|
972
2155
|
}
|
|
973
2156
|
`;
|
|
974
2157
|
document.head.append(style);
|
|
@@ -1034,8 +2217,10 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
1034
2217
|
modified: current.modified,
|
|
1035
2218
|
modelState: this.cloneSerializableValue(this.diffPersistedUnchangedModelState)
|
|
1036
2219
|
});
|
|
2220
|
+
this.applyPendingDiffScrollRestore();
|
|
1037
2221
|
}
|
|
1038
2222
|
scheduleRestorePersistedDiffUnchangedState() {
|
|
2223
|
+
if (this.diffHideUnchangedRegionsDeferred) return;
|
|
1039
2224
|
if (!this.diffPersistedUnchangedModelState) return;
|
|
1040
2225
|
this.rafScheduler.schedule("restore-diff-unchanged-state", () => {
|
|
1041
2226
|
requestAnimationFrame(() => {
|
|
@@ -1043,6 +2228,256 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
1043
2228
|
});
|
|
1044
2229
|
});
|
|
1045
2230
|
}
|
|
2231
|
+
clearDeferredDiffUnchangedRegionsIdleTimer() {
|
|
2232
|
+
if (this.diffHideUnchangedRegionsIdleTimer != null) {
|
|
2233
|
+
clearTimeout(this.diffHideUnchangedRegionsIdleTimer);
|
|
2234
|
+
this.diffHideUnchangedRegionsIdleTimer = null;
|
|
2235
|
+
}
|
|
2236
|
+
}
|
|
2237
|
+
clearPendingDiffThemeSync() {
|
|
2238
|
+
if (this.diffThemeSyncRafId != null) {
|
|
2239
|
+
cancelAnimationFrame(this.diffThemeSyncRafId);
|
|
2240
|
+
this.diffThemeSyncRafId = null;
|
|
2241
|
+
}
|
|
2242
|
+
}
|
|
2243
|
+
withLockedDiffScrollPosition(callback) {
|
|
2244
|
+
var _originalEditor$getSc, _modifiedEditor$getSc, _originalEditor$getSc2, _modifiedEditor$getSc2;
|
|
2245
|
+
if (!this.diffEditorView) {
|
|
2246
|
+
callback();
|
|
2247
|
+
return;
|
|
2248
|
+
}
|
|
2249
|
+
const originalEditor = this.diffEditorView.getOriginalEditor();
|
|
2250
|
+
const modifiedEditor = this.diffEditorView.getModifiedEditor();
|
|
2251
|
+
const originalTop = ((_originalEditor$getSc = originalEditor.getScrollTop) === null || _originalEditor$getSc === void 0 ? void 0 : _originalEditor$getSc.call(originalEditor)) ?? 0;
|
|
2252
|
+
const modifiedTop = ((_modifiedEditor$getSc = modifiedEditor.getScrollTop) === null || _modifiedEditor$getSc === void 0 ? void 0 : _modifiedEditor$getSc.call(modifiedEditor)) ?? 0;
|
|
2253
|
+
const originalLeft = ((_originalEditor$getSc2 = originalEditor.getScrollLeft) === null || _originalEditor$getSc2 === void 0 ? void 0 : _originalEditor$getSc2.call(originalEditor)) ?? 0;
|
|
2254
|
+
const modifiedLeft = ((_modifiedEditor$getSc2 = modifiedEditor.getScrollLeft) === null || _modifiedEditor$getSc2 === void 0 ? void 0 : _modifiedEditor$getSc2.call(modifiedEditor)) ?? 0;
|
|
2255
|
+
callback();
|
|
2256
|
+
const restore = () => {
|
|
2257
|
+
var _originalEditor$setSc, _modifiedEditor$setSc, _originalEditor$setSc2, _modifiedEditor$setSc2;
|
|
2258
|
+
(_originalEditor$setSc = originalEditor.setScrollTop) === null || _originalEditor$setSc === void 0 || _originalEditor$setSc.call(originalEditor, originalTop);
|
|
2259
|
+
(_modifiedEditor$setSc = modifiedEditor.setScrollTop) === null || _modifiedEditor$setSc === void 0 || _modifiedEditor$setSc.call(modifiedEditor, modifiedTop);
|
|
2260
|
+
(_originalEditor$setSc2 = originalEditor.setScrollLeft) === null || _originalEditor$setSc2 === void 0 || _originalEditor$setSc2.call(originalEditor, originalLeft);
|
|
2261
|
+
(_modifiedEditor$setSc2 = modifiedEditor.setScrollLeft) === null || _modifiedEditor$setSc2 === void 0 || _modifiedEditor$setSc2.call(modifiedEditor, modifiedLeft);
|
|
2262
|
+
};
|
|
2263
|
+
restore();
|
|
2264
|
+
requestAnimationFrame(restore);
|
|
2265
|
+
}
|
|
2266
|
+
captureDiffScrollPosition() {
|
|
2267
|
+
var _originalEditor$getSc3, _modifiedEditor$getSc3, _originalEditor$getSc4, _modifiedEditor$getSc4;
|
|
2268
|
+
if (!this.diffEditorView) return null;
|
|
2269
|
+
const originalEditor = this.diffEditorView.getOriginalEditor();
|
|
2270
|
+
const modifiedEditor = this.diffEditorView.getModifiedEditor();
|
|
2271
|
+
return {
|
|
2272
|
+
originalTop: ((_originalEditor$getSc3 = originalEditor.getScrollTop) === null || _originalEditor$getSc3 === void 0 ? void 0 : _originalEditor$getSc3.call(originalEditor)) ?? 0,
|
|
2273
|
+
modifiedTop: ((_modifiedEditor$getSc3 = modifiedEditor.getScrollTop) === null || _modifiedEditor$getSc3 === void 0 ? void 0 : _modifiedEditor$getSc3.call(modifiedEditor)) ?? 0,
|
|
2274
|
+
originalLeft: ((_originalEditor$getSc4 = originalEditor.getScrollLeft) === null || _originalEditor$getSc4 === void 0 ? void 0 : _originalEditor$getSc4.call(originalEditor)) ?? 0,
|
|
2275
|
+
modifiedLeft: ((_modifiedEditor$getSc4 = modifiedEditor.getScrollLeft) === null || _modifiedEditor$getSc4 === void 0 ? void 0 : _modifiedEditor$getSc4.call(modifiedEditor)) ?? 0
|
|
2276
|
+
};
|
|
2277
|
+
}
|
|
2278
|
+
captureModifiedViewportAnchor() {
|
|
2279
|
+
var _modifiedEditor$getCo;
|
|
2280
|
+
if (!this.diffEditorView) return null;
|
|
2281
|
+
const modifiedEditor = this.diffEditorView.getModifiedEditor();
|
|
2282
|
+
const editorRoot = (_modifiedEditor$getCo = modifiedEditor.getContainerDomNode) === null || _modifiedEditor$getCo === void 0 ? void 0 : _modifiedEditor$getCo.call(modifiedEditor);
|
|
2283
|
+
if (!(editorRoot instanceof HTMLElement)) return null;
|
|
2284
|
+
const editorRect = editorRoot.getBoundingClientRect();
|
|
2285
|
+
const anchorNode = Array.from(editorRoot.querySelectorAll(".line-numbers")).map((node) => {
|
|
2286
|
+
var _node$textContent;
|
|
2287
|
+
const lineNumber = Number.parseInt(((_node$textContent = node.textContent) === null || _node$textContent === void 0 ? void 0 : _node$textContent.trim()) || "", 10);
|
|
2288
|
+
const rect = node.getBoundingClientRect();
|
|
2289
|
+
return {
|
|
2290
|
+
node,
|
|
2291
|
+
lineNumber,
|
|
2292
|
+
rect
|
|
2293
|
+
};
|
|
2294
|
+
}).filter(({ lineNumber, rect }) => {
|
|
2295
|
+
return Number.isFinite(lineNumber) && rect.height > 0 && rect.bottom > editorRect.top + 1 && rect.top < editorRect.bottom - 1;
|
|
2296
|
+
}).sort((a, b) => a.rect.top - b.rect.top)[0];
|
|
2297
|
+
if (!anchorNode) return null;
|
|
2298
|
+
return {
|
|
2299
|
+
lineNumber: anchorNode.lineNumber,
|
|
2300
|
+
topOffset: anchorNode.rect.top - editorRect.top
|
|
2301
|
+
};
|
|
2302
|
+
}
|
|
2303
|
+
restoreDiffScrollPosition(position) {
|
|
2304
|
+
if (!this.diffEditorView || !position) return;
|
|
2305
|
+
const originalEditor = this.diffEditorView.getOriginalEditor();
|
|
2306
|
+
const modifiedEditor = this.diffEditorView.getModifiedEditor();
|
|
2307
|
+
const apply = () => {
|
|
2308
|
+
var _originalEditor$setSc3, _modifiedEditor$setSc3, _originalEditor$setSc4, _modifiedEditor$setSc4;
|
|
2309
|
+
(_originalEditor$setSc3 = originalEditor.setScrollTop) === null || _originalEditor$setSc3 === void 0 || _originalEditor$setSc3.call(originalEditor, position.originalTop);
|
|
2310
|
+
(_modifiedEditor$setSc3 = modifiedEditor.setScrollTop) === null || _modifiedEditor$setSc3 === void 0 || _modifiedEditor$setSc3.call(modifiedEditor, position.modifiedTop);
|
|
2311
|
+
(_originalEditor$setSc4 = originalEditor.setScrollLeft) === null || _originalEditor$setSc4 === void 0 || _originalEditor$setSc4.call(originalEditor, position.originalLeft);
|
|
2312
|
+
(_modifiedEditor$setSc4 = modifiedEditor.setScrollLeft) === null || _modifiedEditor$setSc4 === void 0 || _modifiedEditor$setSc4.call(modifiedEditor, position.modifiedLeft);
|
|
2313
|
+
};
|
|
2314
|
+
apply();
|
|
2315
|
+
requestAnimationFrame(() => {
|
|
2316
|
+
apply();
|
|
2317
|
+
requestAnimationFrame(apply);
|
|
2318
|
+
});
|
|
2319
|
+
}
|
|
2320
|
+
restoreModifiedViewportAnchor(anchor) {
|
|
2321
|
+
var _modifiedEditor$getCo2;
|
|
2322
|
+
if (!this.diffEditorView || !anchor) return;
|
|
2323
|
+
const originalEditor = this.diffEditorView.getOriginalEditor();
|
|
2324
|
+
const modifiedEditor = this.diffEditorView.getModifiedEditor();
|
|
2325
|
+
const editorRoot = (_modifiedEditor$getCo2 = modifiedEditor.getContainerDomNode) === null || _modifiedEditor$getCo2 === void 0 ? void 0 : _modifiedEditor$getCo2.call(modifiedEditor);
|
|
2326
|
+
if (!(editorRoot instanceof HTMLElement)) return;
|
|
2327
|
+
const apply = () => {
|
|
2328
|
+
var _Array$from$map$find, _modifiedEditor$getSc5, _originalEditor$setSc5, _modifiedEditor$setSc5;
|
|
2329
|
+
const editorRect = editorRoot.getBoundingClientRect();
|
|
2330
|
+
const currentNode = (_Array$from$map$find = Array.from(editorRoot.querySelectorAll(".line-numbers")).map((node) => {
|
|
2331
|
+
var _node$textContent2;
|
|
2332
|
+
const lineNumber = Number.parseInt(((_node$textContent2 = node.textContent) === null || _node$textContent2 === void 0 ? void 0 : _node$textContent2.trim()) || "", 10);
|
|
2333
|
+
return {
|
|
2334
|
+
node,
|
|
2335
|
+
lineNumber
|
|
2336
|
+
};
|
|
2337
|
+
}).find(({ lineNumber }) => lineNumber === anchor.lineNumber)) === null || _Array$from$map$find === void 0 ? void 0 : _Array$from$map$find.node;
|
|
2338
|
+
if (!(currentNode instanceof HTMLElement)) return;
|
|
2339
|
+
const currentTop = currentNode.getBoundingClientRect().top - editorRect.top;
|
|
2340
|
+
const delta = currentTop - anchor.topOffset;
|
|
2341
|
+
if (Math.abs(delta) < .5) return;
|
|
2342
|
+
const nextTop = (((_modifiedEditor$getSc5 = modifiedEditor.getScrollTop) === null || _modifiedEditor$getSc5 === void 0 ? void 0 : _modifiedEditor$getSc5.call(modifiedEditor)) ?? 0) + delta;
|
|
2343
|
+
(_originalEditor$setSc5 = originalEditor.setScrollTop) === null || _originalEditor$setSc5 === void 0 || _originalEditor$setSc5.call(originalEditor, nextTop);
|
|
2344
|
+
(_modifiedEditor$setSc5 = modifiedEditor.setScrollTop) === null || _modifiedEditor$setSc5 === void 0 || _modifiedEditor$setSc5.call(modifiedEditor, nextTop);
|
|
2345
|
+
};
|
|
2346
|
+
apply();
|
|
2347
|
+
}
|
|
2348
|
+
scheduleRestoreModifiedViewportAnchor(anchor, durationFrames = 8, delayFrames = 0) {
|
|
2349
|
+
if (!anchor) return;
|
|
2350
|
+
let remainingDelay = Math.max(0, delayFrames);
|
|
2351
|
+
let remainingFrames = Math.max(0, durationFrames);
|
|
2352
|
+
const step = () => {
|
|
2353
|
+
if (remainingDelay > 0) {
|
|
2354
|
+
remainingDelay--;
|
|
2355
|
+
requestAnimationFrame(step);
|
|
2356
|
+
return;
|
|
2357
|
+
}
|
|
2358
|
+
this.restoreModifiedViewportAnchor(anchor);
|
|
2359
|
+
if (remainingFrames <= 0) return;
|
|
2360
|
+
remainingFrames--;
|
|
2361
|
+
requestAnimationFrame(step);
|
|
2362
|
+
};
|
|
2363
|
+
step();
|
|
2364
|
+
}
|
|
2365
|
+
queuePendingDiffScrollRestore(position, budget = 2) {
|
|
2366
|
+
if (!position || budget < 1) {
|
|
2367
|
+
this.pendingDiffScrollRestorePosition = null;
|
|
2368
|
+
this.pendingDiffScrollRestoreBudget = 0;
|
|
2369
|
+
return;
|
|
2370
|
+
}
|
|
2371
|
+
this.pendingDiffScrollRestorePosition = { ...position };
|
|
2372
|
+
this.pendingDiffScrollRestoreBudget = budget;
|
|
2373
|
+
}
|
|
2374
|
+
applyPendingDiffScrollRestore() {
|
|
2375
|
+
if (!this.pendingDiffScrollRestorePosition || this.pendingDiffScrollRestoreBudget < 1) return;
|
|
2376
|
+
this.restoreDiffScrollPosition(this.pendingDiffScrollRestorePosition);
|
|
2377
|
+
this.pendingDiffScrollRestoreBudget -= 1;
|
|
2378
|
+
if (this.pendingDiffScrollRestoreBudget < 1) this.pendingDiffScrollRestorePosition = null;
|
|
2379
|
+
}
|
|
2380
|
+
resolveDiffPresentationEditorOptions(hideUnchangedRegions = this.resolveDiffHideUnchangedRegionsOption()) {
|
|
2381
|
+
return {
|
|
2382
|
+
readOnly: this.options.readOnly ?? true,
|
|
2383
|
+
lineDecorationsWidth: this.options.lineDecorationsWidth,
|
|
2384
|
+
lineNumbersMinChars: this.options.lineNumbersMinChars,
|
|
2385
|
+
glyphMargin: this.options.glyphMargin,
|
|
2386
|
+
fontFamily: this.options.fontFamily,
|
|
2387
|
+
fontSize: this.options.fontSize,
|
|
2388
|
+
lineHeight: this.options.lineHeight,
|
|
2389
|
+
padding: this.options.padding,
|
|
2390
|
+
renderLineHighlight: this.options.renderLineHighlight,
|
|
2391
|
+
renderLineHighlightOnlyWhenFocus: this.options.renderLineHighlightOnlyWhenFocus,
|
|
2392
|
+
renderOverviewRuler: this.options.renderOverviewRuler,
|
|
2393
|
+
scrollBeyondLastLine: this.options.scrollBeyondLastLine ?? false,
|
|
2394
|
+
scrollbar: {
|
|
2395
|
+
...defaultScrollbar,
|
|
2396
|
+
...this.options.scrollbar || {}
|
|
2397
|
+
},
|
|
2398
|
+
hideUnchangedRegions: this.diffHideUnchangedRegionsDeferred ? {
|
|
2399
|
+
...hideUnchangedRegions,
|
|
2400
|
+
enabled: false
|
|
2401
|
+
} : hideUnchangedRegions
|
|
2402
|
+
};
|
|
2403
|
+
}
|
|
2404
|
+
refreshDiffPresentation() {
|
|
2405
|
+
var _this$diffHeightManag;
|
|
2406
|
+
if (!this.diffEditorView) return;
|
|
2407
|
+
const hideUnchangedRegions = this.resolveDiffHideUnchangedRegionsOption();
|
|
2408
|
+
const presentationOptions = this.resolveDiffPresentationEditorOptions(hideUnchangedRegions);
|
|
2409
|
+
this.diffHideUnchangedRegionsResolved = hideUnchangedRegions;
|
|
2410
|
+
this.diffUpdateThrottleMs = this.resolveDiffStreamingThrottleMs();
|
|
2411
|
+
if (this.lastContainer) {
|
|
2412
|
+
this.lastContainer.style.maxHeight = this.maxHeightCSS;
|
|
2413
|
+
this.lastContainer.style.removeProperty("--stream-monaco-editor-bg");
|
|
2414
|
+
this.lastContainer.style.removeProperty("--stream-monaco-editor-fg");
|
|
2415
|
+
}
|
|
2416
|
+
this.withLockedDiffScrollPosition(() => {
|
|
2417
|
+
var _this$diffEditorView13;
|
|
2418
|
+
(_this$diffEditorView13 = this.diffEditorView) === null || _this$diffEditorView13 === void 0 || _this$diffEditorView13.updateOptions(presentationOptions);
|
|
2419
|
+
});
|
|
2420
|
+
(_this$diffHeightManag = this.diffHeightManager) === null || _this$diffHeightManag === void 0 || _this$diffHeightManag.update();
|
|
2421
|
+
this.applyDiffRootAppearanceClass();
|
|
2422
|
+
this.schedulePatchDiffUnchangedRegionsAfterInteraction(1);
|
|
2423
|
+
this.repositionDiffHunkNodes();
|
|
2424
|
+
}
|
|
2425
|
+
restoreDeferredDiffUnchangedRegions() {
|
|
2426
|
+
this.clearDeferredDiffUnchangedRegionsIdleTimer();
|
|
2427
|
+
if (!this.diffEditorView) return;
|
|
2428
|
+
const hideUnchangedRegions = this.diffHideUnchangedRegionsResolved;
|
|
2429
|
+
if (!(hideUnchangedRegions === null || hideUnchangedRegions === void 0 ? void 0 : hideUnchangedRegions.enabled)) return;
|
|
2430
|
+
if (!this.diffHideUnchangedRegionsDeferred) return;
|
|
2431
|
+
this.diffHideUnchangedRegionsDeferred = false;
|
|
2432
|
+
this.withLockedDiffScrollPosition(() => {
|
|
2433
|
+
var _this$diffEditorView14;
|
|
2434
|
+
(_this$diffEditorView14 = this.diffEditorView) === null || _this$diffEditorView14 === void 0 || _this$diffEditorView14.updateOptions({ hideUnchangedRegions });
|
|
2435
|
+
});
|
|
2436
|
+
this.schedulePatchDiffUnchangedRegionsAfterInteraction(1);
|
|
2437
|
+
if (this.shouldAutoScrollDiff) {
|
|
2438
|
+
var _this$modifiedModel;
|
|
2439
|
+
this.maybeScrollDiffToBottom((_this$modifiedModel = this.modifiedModel) === null || _this$modifiedModel === void 0 ? void 0 : _this$modifiedModel.getLineCount());
|
|
2440
|
+
}
|
|
2441
|
+
}
|
|
2442
|
+
markDiffStreamingActivity() {
|
|
2443
|
+
const hideUnchangedRegions = this.diffHideUnchangedRegionsResolved;
|
|
2444
|
+
if (!this.diffEditorView || !(hideUnchangedRegions === null || hideUnchangedRegions === void 0 ? void 0 : hideUnchangedRegions.enabled)) return;
|
|
2445
|
+
this.clearDeferredDiffUnchangedRegionsIdleTimer();
|
|
2446
|
+
this.rafScheduler.cancel("restore-diff-unchanged-state");
|
|
2447
|
+
this.diffHideUnchangedRegionsIdleTimer = setTimeout(() => {
|
|
2448
|
+
this.restoreDeferredDiffUnchangedRegions();
|
|
2449
|
+
}, 1800);
|
|
2450
|
+
if (this.diffHideUnchangedRegionsDeferred) return;
|
|
2451
|
+
this.diffHideUnchangedRegionsDeferred = true;
|
|
2452
|
+
this.hideAllDiffUnchangedBridgeEntries();
|
|
2453
|
+
this.withLockedDiffScrollPosition(() => {
|
|
2454
|
+
var _this$diffEditorView15;
|
|
2455
|
+
(_this$diffEditorView15 = this.diffEditorView) === null || _this$diffEditorView15 === void 0 || _this$diffEditorView15.updateOptions({ hideUnchangedRegions: {
|
|
2456
|
+
...hideUnchangedRegions,
|
|
2457
|
+
enabled: false
|
|
2458
|
+
} });
|
|
2459
|
+
});
|
|
2460
|
+
this.schedulePatchDiffUnchangedRegionsAfterInteraction(1);
|
|
2461
|
+
}
|
|
2462
|
+
notifyThemeChange(themeName) {
|
|
2463
|
+
const resolvedThemeName = typeof themeName === "string" ? themeName : themeName === null || themeName === void 0 ? void 0 : themeName.name;
|
|
2464
|
+
if (typeof resolvedThemeName === "string") this.options.theme = resolvedThemeName;
|
|
2465
|
+
this.diffRootAppearanceSignature = null;
|
|
2466
|
+
this.clearPendingDiffThemeSync();
|
|
2467
|
+
if (this.lastContainer) {
|
|
2468
|
+
this.lastContainer.style.removeProperty("--stream-monaco-editor-bg");
|
|
2469
|
+
this.lastContainer.style.removeProperty("--stream-monaco-editor-fg");
|
|
2470
|
+
}
|
|
2471
|
+
const sync = () => {
|
|
2472
|
+
this.diffThemeSyncRafId = null;
|
|
2473
|
+
this.applyDiffRootAppearanceClass();
|
|
2474
|
+
this.schedulePatchDiffUnchangedRegionsAfterInteraction(1);
|
|
2475
|
+
this.repositionDiffHunkNodes();
|
|
2476
|
+
};
|
|
2477
|
+
requestAnimationFrame(() => {
|
|
2478
|
+
this.diffThemeSyncRafId = requestAnimationFrame(sync);
|
|
2479
|
+
});
|
|
2480
|
+
}
|
|
1046
2481
|
bindPersistOnMouseRelease(bucket, node) {
|
|
1047
2482
|
this.createDomDisposable(bucket, node, "mousedown", (event) => {
|
|
1048
2483
|
const mouseEvent = event;
|
|
@@ -1071,6 +2506,8 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
1071
2506
|
this.rafScheduler.cancel("patch-diff-unchanged-regions");
|
|
1072
2507
|
this.rafScheduler.cancel("capture-diff-unchanged-state");
|
|
1073
2508
|
this.rafScheduler.cancel("restore-diff-unchanged-state");
|
|
2509
|
+
this.clearDeferredDiffUnchangedRegionsIdleTimer();
|
|
2510
|
+
this.diffHideUnchangedRegionsDeferred = false;
|
|
1074
2511
|
}
|
|
1075
2512
|
bindFocusVisibleClass(bucket, node) {
|
|
1076
2513
|
this.createDomDisposable(bucket, node, "focus", () => node.classList.add("stream-monaco-focus-visible"));
|
|
@@ -1087,20 +2524,21 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
1087
2524
|
}
|
|
1088
2525
|
clearDiffUnchangedBridgeOverlay(removeContainer = true) {
|
|
1089
2526
|
var _this$diffUnchangedBr;
|
|
1090
|
-
|
|
1091
|
-
const bridgedCenters = this.lastContainer.querySelectorAll(".stream-monaco-unchanged-bridge-source");
|
|
1092
|
-
bridgedCenters.forEach((node) => node.classList.remove("stream-monaco-unchanged-bridge-source"));
|
|
1093
|
-
}
|
|
2527
|
+
this.clearDiffUnchangedBridgeSources();
|
|
1094
2528
|
if (this.diffUnchangedBridgeOverlay) this.diffUnchangedBridgeOverlay.replaceChildren();
|
|
1095
|
-
if (this.
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
}
|
|
2529
|
+
if (this.diffUnchangedBridgeOverlay) this.diffUnchangedBridgeOverlay.style.transform = "translate3d(0px, 0px, 0px)";
|
|
2530
|
+
this.diffUnchangedBridgeEntries.clear();
|
|
2531
|
+
this.diffUnchangedBridgePool.length = 0;
|
|
2532
|
+
this.diffUnchangedOverlayScrollTop = 0;
|
|
2533
|
+
this.diffUnchangedOverlayScrollLeft = 0;
|
|
1101
2534
|
if (removeContainer && ((_this$diffUnchangedBr = this.diffUnchangedBridgeOverlay) === null || _this$diffUnchangedBr === void 0 ? void 0 : _this$diffUnchangedBr.parentElement)) this.diffUnchangedBridgeOverlay.remove();
|
|
1102
2535
|
if (removeContainer) this.diffUnchangedBridgeOverlay = null;
|
|
1103
2536
|
}
|
|
2537
|
+
clearDiffUnchangedBridgeSources() {
|
|
2538
|
+
if (!this.lastContainer) return;
|
|
2539
|
+
const bridgedCenters = this.lastContainer.querySelectorAll(".stream-monaco-unchanged-bridge-source");
|
|
2540
|
+
bridgedCenters.forEach((node) => node.classList.remove("stream-monaco-unchanged-bridge-source"));
|
|
2541
|
+
}
|
|
1104
2542
|
ensureDiffUnchangedBridgeOverlay() {
|
|
1105
2543
|
if (!this.lastContainer) return null;
|
|
1106
2544
|
if (!this.diffUnchangedBridgeOverlay) {
|
|
@@ -1111,6 +2549,255 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
1111
2549
|
}
|
|
1112
2550
|
return this.diffUnchangedBridgeOverlay;
|
|
1113
2551
|
}
|
|
2552
|
+
readDiffUnchangedOverlayScrollState() {
|
|
2553
|
+
var _this$diffEditorView16, _modifiedEditor$getSc6, _modifiedEditor$getSc7;
|
|
2554
|
+
const modifiedEditor = (_this$diffEditorView16 = this.diffEditorView) === null || _this$diffEditorView16 === void 0 ? void 0 : _this$diffEditorView16.getModifiedEditor();
|
|
2555
|
+
return {
|
|
2556
|
+
top: (modifiedEditor === null || modifiedEditor === void 0 || (_modifiedEditor$getSc6 = modifiedEditor.getScrollTop) === null || _modifiedEditor$getSc6 === void 0 ? void 0 : _modifiedEditor$getSc6.call(modifiedEditor)) ?? 0,
|
|
2557
|
+
left: (modifiedEditor === null || modifiedEditor === void 0 || (_modifiedEditor$getSc7 = modifiedEditor.getScrollLeft) === null || _modifiedEditor$getSc7 === void 0 ? void 0 : _modifiedEditor$getSc7.call(modifiedEditor)) ?? 0
|
|
2558
|
+
};
|
|
2559
|
+
}
|
|
2560
|
+
syncDiffUnchangedOverlayScrollBaseline() {
|
|
2561
|
+
const overlay = this.diffUnchangedBridgeOverlay;
|
|
2562
|
+
if (overlay) overlay.style.transform = "translate3d(0px, 0px, 0px)";
|
|
2563
|
+
const { top, left } = this.readDiffUnchangedOverlayScrollState();
|
|
2564
|
+
this.diffUnchangedOverlayScrollTop = top;
|
|
2565
|
+
this.diffUnchangedOverlayScrollLeft = left;
|
|
2566
|
+
}
|
|
2567
|
+
applyDiffUnchangedOverlayScrollCompensation() {
|
|
2568
|
+
const overlay = this.diffUnchangedBridgeOverlay;
|
|
2569
|
+
if (!overlay || overlay.hidden) return;
|
|
2570
|
+
const { top, left } = this.readDiffUnchangedOverlayScrollState();
|
|
2571
|
+
const deltaY = this.diffUnchangedOverlayScrollTop - top;
|
|
2572
|
+
const deltaX = this.diffUnchangedOverlayScrollLeft - left;
|
|
2573
|
+
if (Math.abs(deltaY) < .5 && Math.abs(deltaX) < .5) return;
|
|
2574
|
+
overlay.style.transform = `translate3d(${deltaX}px, ${deltaY}px, 0px)`;
|
|
2575
|
+
}
|
|
2576
|
+
resolveDiffUnchangedViewZoneHeight() {
|
|
2577
|
+
switch (this.resolveDiffUnchangedRegionStyleOption()) {
|
|
2578
|
+
case "line-info":
|
|
2579
|
+
case "line-info-basic":
|
|
2580
|
+
case "metadata": return 32;
|
|
2581
|
+
case "simple": return 28;
|
|
2582
|
+
default: return 32;
|
|
2583
|
+
}
|
|
2584
|
+
}
|
|
2585
|
+
collectDiffUnchangedViewZoneIds(editorRoot, scrollTop) {
|
|
2586
|
+
const widgetTopValues = Array.from(editorRoot.querySelectorAll(".diff-hidden-lines-widget")).map((node) => Number.parseFloat(node.style.top || "NaN")).filter((value) => Number.isFinite(value) && value > -1e5);
|
|
2587
|
+
if (widgetTopValues.length === 0) return [];
|
|
2588
|
+
return Array.from(editorRoot.querySelectorAll(".view-zones > div[monaco-view-zone][monaco-visible-view-zone=\"true\"]")).filter((node) => {
|
|
2589
|
+
const zoneTop = Number.parseFloat(node.style.top || "NaN");
|
|
2590
|
+
const currentHeight = Number.parseFloat(node.style.height || "0");
|
|
2591
|
+
return Number.isFinite(zoneTop) && Number.isFinite(currentHeight) && currentHeight > 0 && widgetTopValues.some((widgetTop) => Math.abs(zoneTop - scrollTop - widgetTop) < .5);
|
|
2592
|
+
}).map((node) => node.getAttribute("monaco-view-zone")).filter((value) => Boolean(value));
|
|
2593
|
+
}
|
|
2594
|
+
syncDiffUnchangedViewZoneHeightsForEditor(editor, editorRoot, targetHeight) {
|
|
2595
|
+
var _editor$getScrollTop, _editorInternal$_mode;
|
|
2596
|
+
if (!editor || !(editorRoot instanceof HTMLElement)) return false;
|
|
2597
|
+
const zoneIds = this.collectDiffUnchangedViewZoneIds(editorRoot, ((_editor$getScrollTop = editor.getScrollTop) === null || _editor$getScrollTop === void 0 ? void 0 : _editor$getScrollTop.call(editor)) ?? 0);
|
|
2598
|
+
if (zoneIds.length === 0) return false;
|
|
2599
|
+
const editorInternal = editor;
|
|
2600
|
+
const zones = (_editorInternal$_mode = editorInternal._modelData) === null || _editorInternal$_mode === void 0 || (_editorInternal$_mode = _editorInternal$_mode.view) === null || _editorInternal$_mode === void 0 || (_editorInternal$_mode = _editorInternal$_mode._viewZones) === null || _editorInternal$_mode === void 0 ? void 0 : _editorInternal$_mode._zones;
|
|
2601
|
+
if (!zones) return false;
|
|
2602
|
+
const changedZoneIds = zoneIds.filter((id) => {
|
|
2603
|
+
var _zones$id;
|
|
2604
|
+
const delegate = (_zones$id = zones[id]) === null || _zones$id === void 0 ? void 0 : _zones$id.delegate;
|
|
2605
|
+
return delegate && delegate.heightInPx !== targetHeight;
|
|
2606
|
+
});
|
|
2607
|
+
if (changedZoneIds.length === 0) return false;
|
|
2608
|
+
editor.changeViewZones((accessor) => {
|
|
2609
|
+
for (const id of changedZoneIds) {
|
|
2610
|
+
var _zones$id2;
|
|
2611
|
+
const delegate = (_zones$id2 = zones[id]) === null || _zones$id2 === void 0 ? void 0 : _zones$id2.delegate;
|
|
2612
|
+
if (!delegate) continue;
|
|
2613
|
+
delegate.heightInPx = targetHeight;
|
|
2614
|
+
accessor.layoutZone(id);
|
|
2615
|
+
}
|
|
2616
|
+
});
|
|
2617
|
+
return true;
|
|
2618
|
+
}
|
|
2619
|
+
syncDiffUnchangedViewZoneHeights() {
|
|
2620
|
+
var _originalEditor$getCo, _modifiedEditor$getCo3;
|
|
2621
|
+
if (!this.diffEditorView) return false;
|
|
2622
|
+
const targetHeight = this.resolveDiffUnchangedViewZoneHeight();
|
|
2623
|
+
const originalEditor = this.diffEditorView.getOriginalEditor();
|
|
2624
|
+
const modifiedEditor = this.diffEditorView.getModifiedEditor();
|
|
2625
|
+
const originalChanged = this.syncDiffUnchangedViewZoneHeightsForEditor(originalEditor, (_originalEditor$getCo = originalEditor.getContainerDomNode) === null || _originalEditor$getCo === void 0 ? void 0 : _originalEditor$getCo.call(originalEditor), targetHeight);
|
|
2626
|
+
const modifiedChanged = this.syncDiffUnchangedViewZoneHeightsForEditor(modifiedEditor, (_modifiedEditor$getCo3 = modifiedEditor.getContainerDomNode) === null || _modifiedEditor$getCo3 === void 0 ? void 0 : _modifiedEditor$getCo3.call(modifiedEditor), targetHeight);
|
|
2627
|
+
return originalChanged || modifiedChanged;
|
|
2628
|
+
}
|
|
2629
|
+
getDiffUnchangedNodeId(node) {
|
|
2630
|
+
const existingId = this.diffUnchangedNodeIds.get(node);
|
|
2631
|
+
if (existingId) return existingId;
|
|
2632
|
+
const nextId = `diff-unchanged-${++this.diffUnchangedNodeIdSequence}`;
|
|
2633
|
+
this.diffUnchangedNodeIds.set(node, nextId);
|
|
2634
|
+
return nextId;
|
|
2635
|
+
}
|
|
2636
|
+
getDiffUnchangedBridgeKey(secondaryNode, primaryNode) {
|
|
2637
|
+
return `${this.getDiffUnchangedNodeId(secondaryNode)}:${this.getDiffUnchangedNodeId(primaryNode)}`;
|
|
2638
|
+
}
|
|
2639
|
+
createDiffUnchangedBridgeEntry(key) {
|
|
2640
|
+
const bridge = document.createElement("div");
|
|
2641
|
+
bridge.className = "stream-monaco-diff-unchanged-bridge";
|
|
2642
|
+
bridge.setAttribute("role", "group");
|
|
2643
|
+
bridge.hidden = true;
|
|
2644
|
+
const summary = document.createElement("button");
|
|
2645
|
+
summary.type = "button";
|
|
2646
|
+
summary.className = "stream-monaco-unchanged-summary";
|
|
2647
|
+
const visualMeta = document.createElement("div");
|
|
2648
|
+
visualMeta.className = "stream-monaco-unchanged-meta";
|
|
2649
|
+
summary.append(visualMeta);
|
|
2650
|
+
const divider = document.createElement("span");
|
|
2651
|
+
divider.className = "stream-monaco-unchanged-pane-divider";
|
|
2652
|
+
divider.setAttribute("aria-hidden", "true");
|
|
2653
|
+
const entry = {
|
|
2654
|
+
key,
|
|
2655
|
+
bridge,
|
|
2656
|
+
rail: null,
|
|
2657
|
+
summary,
|
|
2658
|
+
visualMeta,
|
|
2659
|
+
divider,
|
|
2660
|
+
activate: () => {},
|
|
2661
|
+
topButton: null,
|
|
2662
|
+
bottomButton: null
|
|
2663
|
+
};
|
|
2664
|
+
summary.onclick = (event) => {
|
|
2665
|
+
event.preventDefault();
|
|
2666
|
+
this.activateDiffUnchangedBridgeEntry(entry);
|
|
2667
|
+
};
|
|
2668
|
+
const onWheel = (event) => {
|
|
2669
|
+
var _modifiedEditor$getSc8, _modifiedEditor$getSc9, _originalEditor$setSc6, _modifiedEditor$setSc6;
|
|
2670
|
+
if (!this.diffEditorView) return;
|
|
2671
|
+
if (Math.abs(event.deltaY) < .5 && Math.abs(event.deltaX) < .5) return;
|
|
2672
|
+
event.preventDefault();
|
|
2673
|
+
event.stopPropagation();
|
|
2674
|
+
const originalEditor = this.diffEditorView.getOriginalEditor();
|
|
2675
|
+
const modifiedEditor = this.diffEditorView.getModifiedEditor();
|
|
2676
|
+
const targetScrollTop = (((_modifiedEditor$getSc8 = modifiedEditor.getScrollTop) === null || _modifiedEditor$getSc8 === void 0 ? void 0 : _modifiedEditor$getSc8.call(modifiedEditor)) ?? 0) + event.deltaY;
|
|
2677
|
+
const targetScrollLeft = (((_modifiedEditor$getSc9 = modifiedEditor.getScrollLeft) === null || _modifiedEditor$getSc9 === void 0 ? void 0 : _modifiedEditor$getSc9.call(modifiedEditor)) ?? 0) + event.deltaX;
|
|
2678
|
+
(_originalEditor$setSc6 = originalEditor.setScrollTop) === null || _originalEditor$setSc6 === void 0 || _originalEditor$setSc6.call(originalEditor, targetScrollTop);
|
|
2679
|
+
(_modifiedEditor$setSc6 = modifiedEditor.setScrollTop) === null || _modifiedEditor$setSc6 === void 0 || _modifiedEditor$setSc6.call(modifiedEditor, targetScrollTop);
|
|
2680
|
+
if (Math.abs(event.deltaX) >= .5) {
|
|
2681
|
+
var _originalEditor$setSc7, _modifiedEditor$setSc7;
|
|
2682
|
+
(_originalEditor$setSc7 = originalEditor.setScrollLeft) === null || _originalEditor$setSc7 === void 0 || _originalEditor$setSc7.call(originalEditor, targetScrollLeft);
|
|
2683
|
+
(_modifiedEditor$setSc7 = modifiedEditor.setScrollLeft) === null || _modifiedEditor$setSc7 === void 0 || _modifiedEditor$setSc7.call(modifiedEditor, targetScrollLeft);
|
|
2684
|
+
}
|
|
2685
|
+
this.schedulePatchDiffUnchangedRegionsAfterScroll();
|
|
2686
|
+
};
|
|
2687
|
+
bridge.addEventListener("wheel", onWheel, { passive: false });
|
|
2688
|
+
this.diffUnchangedRegionDisposables.push({ dispose: () => bridge.removeEventListener("wheel", onWheel) });
|
|
2689
|
+
bridge.append(summary, divider);
|
|
2690
|
+
return entry;
|
|
2691
|
+
}
|
|
2692
|
+
acquireDiffUnchangedBridgeEntry(key) {
|
|
2693
|
+
const existing = this.diffUnchangedBridgeEntries.get(key);
|
|
2694
|
+
if (existing) return existing;
|
|
2695
|
+
const entry = this.diffUnchangedBridgePool.pop() ?? this.createDiffUnchangedBridgeEntry(key);
|
|
2696
|
+
entry.key = key;
|
|
2697
|
+
entry.bridge.hidden = false;
|
|
2698
|
+
entry.bridge.removeAttribute("aria-hidden");
|
|
2699
|
+
this.diffUnchangedBridgeEntries.set(key, entry);
|
|
2700
|
+
return entry;
|
|
2701
|
+
}
|
|
2702
|
+
releaseDiffUnchangedBridgeEntry(entry) {
|
|
2703
|
+
if (entry.key) this.diffUnchangedBridgeEntries.delete(entry.key);
|
|
2704
|
+
entry.key = null;
|
|
2705
|
+
entry.bridge.hidden = true;
|
|
2706
|
+
entry.bridge.setAttribute("aria-hidden", "true");
|
|
2707
|
+
this.diffUnchangedBridgePool.push(entry);
|
|
2708
|
+
}
|
|
2709
|
+
hideAllDiffUnchangedBridgeEntries() {
|
|
2710
|
+
for (const entry of Array.from(this.diffUnchangedBridgeEntries.values())) this.releaseDiffUnchangedBridgeEntry(entry);
|
|
2711
|
+
this.clearDiffUnchangedBridgeSources();
|
|
2712
|
+
}
|
|
2713
|
+
schedulePatchDiffUnchangedRegionsAfterInteraction(frames = 1) {
|
|
2714
|
+
this.rafScheduler.schedule("patch-diff-unchanged-regions-after-interaction", () => {
|
|
2715
|
+
let remaining = Math.max(0, frames);
|
|
2716
|
+
const step = () => {
|
|
2717
|
+
if (remaining > 0) {
|
|
2718
|
+
remaining--;
|
|
2719
|
+
requestAnimationFrame(step);
|
|
2720
|
+
return;
|
|
2721
|
+
}
|
|
2722
|
+
this.schedulePatchDiffUnchangedRegions();
|
|
2723
|
+
};
|
|
2724
|
+
step();
|
|
2725
|
+
});
|
|
2726
|
+
}
|
|
2727
|
+
activateDiffUnchangedBridgeEntry(entry) {
|
|
2728
|
+
this.hideAllDiffUnchangedBridgeEntries();
|
|
2729
|
+
entry.activate();
|
|
2730
|
+
this.schedulePatchDiffUnchangedRegionsAfterInteraction();
|
|
2731
|
+
}
|
|
2732
|
+
updateDiffUnchangedBridgeMeta(entry, unchangedRegionStyle, summaryLabel) {
|
|
2733
|
+
this.updateDiffUnchangedMetaNode(entry.visualMeta, unchangedRegionStyle, summaryLabel);
|
|
2734
|
+
}
|
|
2735
|
+
updateDiffUnchangedMetaNode(metaNode, unchangedRegionStyle, summaryLabel) {
|
|
2736
|
+
const lastStyle = metaNode.dataset.style;
|
|
2737
|
+
const lastLabel = metaNode.dataset.label;
|
|
2738
|
+
if (lastStyle === unchangedRegionStyle && lastLabel === summaryLabel) return;
|
|
2739
|
+
metaNode.dataset.style = unchangedRegionStyle;
|
|
2740
|
+
metaNode.dataset.label = summaryLabel;
|
|
2741
|
+
metaNode.replaceChildren();
|
|
2742
|
+
metaNode.classList.toggle("stream-monaco-unchanged-meta-simple", unchangedRegionStyle === "simple");
|
|
2743
|
+
if (unchangedRegionStyle === "simple") {
|
|
2744
|
+
const simpleBar = document.createElement("span");
|
|
2745
|
+
simpleBar.className = "stream-monaco-unchanged-simple-bar";
|
|
2746
|
+
simpleBar.setAttribute("aria-hidden", "true");
|
|
2747
|
+
metaNode.append(simpleBar);
|
|
2748
|
+
return;
|
|
2749
|
+
}
|
|
2750
|
+
const label = document.createElement("span");
|
|
2751
|
+
if (unchangedRegionStyle === "metadata") label.className = "stream-monaco-unchanged-metadata-label";
|
|
2752
|
+
else label.className = "stream-monaco-unchanged-count";
|
|
2753
|
+
label.textContent = summaryLabel;
|
|
2754
|
+
metaNode.append(label);
|
|
2755
|
+
}
|
|
2756
|
+
syncDiffUnchangedRevealButton(entry, slot, handle, direction, label) {
|
|
2757
|
+
const existingButton = entry[slot];
|
|
2758
|
+
const button = existingButton ?? document.createElement("button");
|
|
2759
|
+
if (!existingButton) {
|
|
2760
|
+
button.type = "button";
|
|
2761
|
+
button.className = "stream-monaco-unchanged-reveal";
|
|
2762
|
+
button.innerHTML = `<span class="codicon codicon-chevron-${direction}"></span>`;
|
|
2763
|
+
}
|
|
2764
|
+
button.dataset.direction = direction;
|
|
2765
|
+
button.hidden = !handle;
|
|
2766
|
+
button.disabled = !handle;
|
|
2767
|
+
button.toggleAttribute("aria-hidden", !handle);
|
|
2768
|
+
button.title = handle ? label : "";
|
|
2769
|
+
button.setAttribute("aria-label", handle ? label : "");
|
|
2770
|
+
button.onclick = handle ? (event) => {
|
|
2771
|
+
event.preventDefault();
|
|
2772
|
+
event.stopPropagation();
|
|
2773
|
+
this.hideAllDiffUnchangedBridgeEntries();
|
|
2774
|
+
this.activateDiffUnchangedHandle(handle);
|
|
2775
|
+
this.schedulePatchDiffUnchangedRegionsAfterInteraction();
|
|
2776
|
+
} : null;
|
|
2777
|
+
entry[slot] = button;
|
|
2778
|
+
}
|
|
2779
|
+
syncDiffUnchangedBridgeRail(entry, showTopHandle, topHandle, showBottomHandle, bottomHandle) {
|
|
2780
|
+
if (!entry.rail) {
|
|
2781
|
+
entry.rail = document.createElement("div");
|
|
2782
|
+
entry.rail.className = "stream-monaco-unchanged-rail";
|
|
2783
|
+
}
|
|
2784
|
+
const shouldRenderRail = showTopHandle || showBottomHandle;
|
|
2785
|
+
this.syncDiffUnchangedRevealButton(entry, "topButton", showTopHandle ? topHandle : null, "down", "Reveal more unmodified lines below");
|
|
2786
|
+
this.syncDiffUnchangedRevealButton(entry, "bottomButton", showBottomHandle ? bottomHandle : null, "up", "Reveal more unmodified lines above");
|
|
2787
|
+
entry.rail.hidden = !shouldRenderRail;
|
|
2788
|
+
entry.rail.toggleAttribute("aria-hidden", !shouldRenderRail);
|
|
2789
|
+
entry.rail.classList.toggle("stream-monaco-unchanged-rail-top-only", showTopHandle && !showBottomHandle);
|
|
2790
|
+
entry.rail.classList.toggle("stream-monaco-unchanged-rail-bottom-only", !showTopHandle && showBottomHandle);
|
|
2791
|
+
entry.rail.classList.toggle("stream-monaco-unchanged-rail-both", showTopHandle && showBottomHandle);
|
|
2792
|
+
if (entry.topButton && entry.topButton.parentElement !== entry.rail) entry.rail.append(entry.topButton);
|
|
2793
|
+
if (entry.bottomButton && entry.bottomButton.parentElement !== entry.rail) entry.rail.append(entry.bottomButton);
|
|
2794
|
+
}
|
|
2795
|
+
pruneDiffUnchangedBridgeEntries(visibleKeys) {
|
|
2796
|
+
for (const [key, entry] of Array.from(this.diffUnchangedBridgeEntries)) {
|
|
2797
|
+
if (visibleKeys.has(key)) continue;
|
|
2798
|
+
this.releaseDiffUnchangedBridgeEntry(entry);
|
|
2799
|
+
}
|
|
2800
|
+
}
|
|
1114
2801
|
dispatchSyntheticMouseDown(node) {
|
|
1115
2802
|
const view = node.ownerDocument.defaultView;
|
|
1116
2803
|
if (!view) return;
|
|
@@ -1123,14 +2810,152 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
1123
2810
|
clientY: rect.top + rect.height / 2
|
|
1124
2811
|
}));
|
|
1125
2812
|
}
|
|
2813
|
+
dispatchSyntheticMouseTap(node) {
|
|
2814
|
+
const view = node.ownerDocument.defaultView;
|
|
2815
|
+
if (!view) return;
|
|
2816
|
+
const rect = node.getBoundingClientRect();
|
|
2817
|
+
const clientX = rect.left + rect.width / 2;
|
|
2818
|
+
const clientY = rect.top + rect.height / 2;
|
|
2819
|
+
node.dispatchEvent(new view.MouseEvent("mousedown", {
|
|
2820
|
+
bubbles: true,
|
|
2821
|
+
cancelable: true,
|
|
2822
|
+
button: 0,
|
|
2823
|
+
clientX,
|
|
2824
|
+
clientY
|
|
2825
|
+
}));
|
|
2826
|
+
node.dispatchEvent(new view.MouseEvent("mouseup", {
|
|
2827
|
+
bubbles: true,
|
|
2828
|
+
cancelable: true,
|
|
2829
|
+
button: 0,
|
|
2830
|
+
clientX,
|
|
2831
|
+
clientY
|
|
2832
|
+
}));
|
|
2833
|
+
}
|
|
2834
|
+
formatDiffUnchangedCountLabel(text) {
|
|
2835
|
+
const match = text.match(/\d+/);
|
|
2836
|
+
const count = match ? Number.parseInt(match[0], 10) : NaN;
|
|
2837
|
+
if (Number.isFinite(count)) return `${count} unmodified ${count === 1 ? "line" : "lines"}`;
|
|
2838
|
+
return text.replace(/hidden/gi, "unmodified");
|
|
2839
|
+
}
|
|
2840
|
+
countDiffLines(startLineNumber, endLineNumber) {
|
|
2841
|
+
return endLineNumber >= startLineNumber ? endLineNumber - startLineNumber + 1 : 0;
|
|
2842
|
+
}
|
|
2843
|
+
measureDiffUnchangedSurroundingLines(primaryNode) {
|
|
2844
|
+
const editorRoot = primaryNode.closest(".editor.modified") ?? primaryNode.closest(".monaco-editor");
|
|
2845
|
+
if (!editorRoot) return {
|
|
2846
|
+
previousVisibleLine: null,
|
|
2847
|
+
nextVisibleLine: null
|
|
2848
|
+
};
|
|
2849
|
+
const widgetRect = primaryNode.getBoundingClientRect();
|
|
2850
|
+
let previousVisibleLine = null;
|
|
2851
|
+
let nextVisibleLine = null;
|
|
2852
|
+
const lineNumberNodes = editorRoot.querySelectorAll(".line-numbers");
|
|
2853
|
+
lineNumberNodes.forEach((node) => {
|
|
2854
|
+
var _node$textContent3;
|
|
2855
|
+
const lineNumber = Number.parseInt(((_node$textContent3 = node.textContent) === null || _node$textContent3 === void 0 ? void 0 : _node$textContent3.trim()) || "", 10);
|
|
2856
|
+
if (!Number.isFinite(lineNumber)) return;
|
|
2857
|
+
const top = node.getBoundingClientRect().top;
|
|
2858
|
+
if (top < widgetRect.top - 1) previousVisibleLine = previousVisibleLine == null ? lineNumber : Math.max(previousVisibleLine, lineNumber);
|
|
2859
|
+
else if (top > widgetRect.bottom + 1) nextVisibleLine = nextVisibleLine == null ? lineNumber : Math.min(nextVisibleLine, lineNumber);
|
|
2860
|
+
});
|
|
2861
|
+
return {
|
|
2862
|
+
previousVisibleLine,
|
|
2863
|
+
nextVisibleLine
|
|
2864
|
+
};
|
|
2865
|
+
}
|
|
2866
|
+
formatDiffMetadataRange(startLineNumber, lineCount) {
|
|
2867
|
+
return `${startLineNumber},${Math.max(0, lineCount)}`;
|
|
2868
|
+
}
|
|
2869
|
+
buildDiffHunkMetadataLabel(change) {
|
|
2870
|
+
var _this$originalModel, _this$modifiedModel2;
|
|
2871
|
+
const contextLineCount = this.resolveDiffHideUnchangedRegionsOption().contextLineCount ?? 3;
|
|
2872
|
+
const originalTotalLines = ((_this$originalModel = this.originalModel) === null || _this$originalModel === void 0 ? void 0 : _this$originalModel.getLineCount()) ?? 0;
|
|
2873
|
+
const modifiedTotalLines = ((_this$modifiedModel2 = this.modifiedModel) === null || _this$modifiedModel2 === void 0 ? void 0 : _this$modifiedModel2.getLineCount()) ?? 0;
|
|
2874
|
+
const originalChangedCount = this.countDiffLines(change.originalStartLineNumber, change.originalEndLineNumber);
|
|
2875
|
+
const modifiedChangedCount = this.countDiffLines(change.modifiedStartLineNumber, change.modifiedEndLineNumber);
|
|
2876
|
+
const originalAnchor = Math.min(Math.max(change.originalStartLineNumber, 1), Math.max(1, originalTotalLines + 1));
|
|
2877
|
+
const modifiedAnchor = Math.min(Math.max(change.modifiedStartLineNumber, 1), Math.max(1, modifiedTotalLines + 1));
|
|
2878
|
+
const originalStart = Math.max(1, originalAnchor - contextLineCount);
|
|
2879
|
+
const modifiedStart = Math.max(1, modifiedAnchor - contextLineCount);
|
|
2880
|
+
const originalEnd = originalChangedCount > 0 ? Math.min(originalTotalLines, change.originalEndLineNumber + contextLineCount) : Math.min(originalTotalLines, originalAnchor + contextLineCount - 1);
|
|
2881
|
+
const modifiedEnd = modifiedChangedCount > 0 ? Math.min(modifiedTotalLines, change.modifiedEndLineNumber + contextLineCount) : Math.min(modifiedTotalLines, modifiedAnchor + contextLineCount - 1);
|
|
2882
|
+
const originalDisplayCount = originalEnd >= originalStart ? originalEnd - originalStart + 1 : 0;
|
|
2883
|
+
const modifiedDisplayCount = modifiedEnd >= modifiedStart ? modifiedEnd - modifiedStart + 1 : 0;
|
|
2884
|
+
return {
|
|
2885
|
+
modifiedStart,
|
|
2886
|
+
originalStart,
|
|
2887
|
+
label: `@@ -${this.formatDiffMetadataRange(originalStart, originalDisplayCount)} +${this.formatDiffMetadataRange(modifiedStart, modifiedDisplayCount)} @@`
|
|
2888
|
+
};
|
|
2889
|
+
}
|
|
2890
|
+
resolveDiffMetadataLabel(primaryNode, pairIndex) {
|
|
2891
|
+
var _metadataEntries$Math;
|
|
2892
|
+
const lineChanges = this.getEffectiveLineChanges();
|
|
2893
|
+
if (lineChanges.length === 0) return null;
|
|
2894
|
+
const metadataEntries = lineChanges.map((change) => this.buildDiffHunkMetadataLabel(change));
|
|
2895
|
+
const { nextVisibleLine } = this.measureDiffUnchangedSurroundingLines(primaryNode);
|
|
2896
|
+
if (nextVisibleLine != null) {
|
|
2897
|
+
const candidateStarts = [nextVisibleLine, nextVisibleLine - 1].filter((value) => value >= 1);
|
|
2898
|
+
for (const candidateStart of candidateStarts) {
|
|
2899
|
+
const matching = metadataEntries.find((entry) => entry.modifiedStart === candidateStart);
|
|
2900
|
+
if (matching) return matching.label;
|
|
2901
|
+
}
|
|
2902
|
+
}
|
|
2903
|
+
return ((_metadataEntries$Math = metadataEntries[Math.min(pairIndex, metadataEntries.length - 1)]) === null || _metadataEntries$Math === void 0 ? void 0 : _metadataEntries$Math.label) ?? null;
|
|
2904
|
+
}
|
|
2905
|
+
activateDiffUnchangedHandle(node) {
|
|
2906
|
+
if (!(node instanceof HTMLElement)) return;
|
|
2907
|
+
this.dispatchSyntheticMouseTap(node);
|
|
2908
|
+
this.scheduleCapturePersistedDiffUnchangedState(1);
|
|
2909
|
+
}
|
|
2910
|
+
resolveDiffUnchangedRevealLayout(primaryNode, countText, pairIndex, pairCount) {
|
|
2911
|
+
var _this$diffEditorView17, _this$diffEditorView18;
|
|
2912
|
+
let showTopHandle = pairCount === 1 || pairIndex > 0;
|
|
2913
|
+
let showBottomHandle = pairCount === 1 || pairIndex < pairCount - 1;
|
|
2914
|
+
const countMatch = countText.match(/\d+/);
|
|
2915
|
+
const hiddenCount = countMatch ? Number.parseInt(countMatch[0], 10) : NaN;
|
|
2916
|
+
if (!Number.isFinite(hiddenCount)) return {
|
|
2917
|
+
showTopHandle,
|
|
2918
|
+
showBottomHandle
|
|
2919
|
+
};
|
|
2920
|
+
const { previousVisibleLine, nextVisibleLine } = this.measureDiffUnchangedSurroundingLines(primaryNode);
|
|
2921
|
+
if (previousVisibleLine == null && nextVisibleLine != null) {
|
|
2922
|
+
showTopHandle = false;
|
|
2923
|
+
showBottomHandle = true;
|
|
2924
|
+
return {
|
|
2925
|
+
showTopHandle,
|
|
2926
|
+
showBottomHandle
|
|
2927
|
+
};
|
|
2928
|
+
}
|
|
2929
|
+
if (nextVisibleLine == null && previousVisibleLine != null) {
|
|
2930
|
+
showTopHandle = true;
|
|
2931
|
+
showBottomHandle = false;
|
|
2932
|
+
return {
|
|
2933
|
+
showTopHandle,
|
|
2934
|
+
showBottomHandle
|
|
2935
|
+
};
|
|
2936
|
+
}
|
|
2937
|
+
if (nextVisibleLine != null && nextVisibleLine - hiddenCount === 1) {
|
|
2938
|
+
showTopHandle = false;
|
|
2939
|
+
showBottomHandle = true;
|
|
2940
|
+
}
|
|
2941
|
+
const modelLineCount = ((_this$diffEditorView17 = this.diffEditorView) === null || _this$diffEditorView17 === void 0 || (_this$diffEditorView17 = _this$diffEditorView17.getModifiedEditor().getModel()) === null || _this$diffEditorView17 === void 0 || (_this$diffEditorView18 = _this$diffEditorView17.getLineCount) === null || _this$diffEditorView18 === void 0 ? void 0 : _this$diffEditorView18.call(_this$diffEditorView17)) ?? null;
|
|
2942
|
+
if (previousVisibleLine != null && modelLineCount != null && previousVisibleLine + hiddenCount === modelLineCount) {
|
|
2943
|
+
showTopHandle = true;
|
|
2944
|
+
showBottomHandle = false;
|
|
2945
|
+
}
|
|
2946
|
+
return {
|
|
2947
|
+
showTopHandle,
|
|
2948
|
+
showBottomHandle
|
|
2949
|
+
};
|
|
2950
|
+
}
|
|
1126
2951
|
resolveDiffUnchangedMergeRole(node) {
|
|
1127
|
-
var _this$
|
|
2952
|
+
var _this$diffEditorView19, _this$diffEditorView20, _this$diffEditorView21, _this$diffEditorView22, _this$diffEditorView23, _this$diffEditorView24;
|
|
1128
2953
|
const diffRoot = node.closest(".monaco-diff-editor.side-by-side");
|
|
1129
2954
|
if (!(diffRoot instanceof HTMLElement)) return "none";
|
|
1130
2955
|
const nodeRect = node.getBoundingClientRect();
|
|
1131
2956
|
const nodeCenter = nodeRect.left + nodeRect.width / 2;
|
|
1132
|
-
const originalHost = (_this$
|
|
1133
|
-
const modifiedHost = (_this$
|
|
2957
|
+
const originalHost = (_this$diffEditorView19 = this.diffEditorView) === null || _this$diffEditorView19 === void 0 || (_this$diffEditorView21 = (_this$diffEditorView20 = _this$diffEditorView19.getOriginalEditor()).getContainerDomNode) === null || _this$diffEditorView21 === void 0 ? void 0 : _this$diffEditorView21.call(_this$diffEditorView20);
|
|
2958
|
+
const modifiedHost = (_this$diffEditorView22 = this.diffEditorView) === null || _this$diffEditorView22 === void 0 || (_this$diffEditorView24 = (_this$diffEditorView23 = _this$diffEditorView22.getModifiedEditor()).getContainerDomNode) === null || _this$diffEditorView24 === void 0 ? void 0 : _this$diffEditorView24.call(_this$diffEditorView23);
|
|
1134
2959
|
if (originalHost instanceof HTMLElement && modifiedHost instanceof HTMLElement) {
|
|
1135
2960
|
const originalRect = originalHost.getBoundingClientRect();
|
|
1136
2961
|
const modifiedRect = modifiedHost.getBoundingClientRect();
|
|
@@ -1141,39 +2966,39 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
1141
2966
|
const diffRect = diffRoot.getBoundingClientRect();
|
|
1142
2967
|
return nodeCenter < diffRect.left + diffRect.width / 2 ? "secondary" : "primary";
|
|
1143
2968
|
}
|
|
1144
|
-
patchDiffUnchangedCenter(node) {
|
|
2969
|
+
patchDiffUnchangedCenter(node, pairIndex = 0) {
|
|
1145
2970
|
node.classList.add("stream-monaco-clickable");
|
|
1146
|
-
node.title = "Click to expand all
|
|
2971
|
+
node.title = "Click to expand all unmodified lines";
|
|
1147
2972
|
const mergeRole = this.resolveDiffUnchangedMergeRole(node);
|
|
1148
2973
|
const shouldUseMergedSecondary = mergeRole === "secondary";
|
|
2974
|
+
const unchangedRegionStyle = this.resolveDiffUnchangedRegionStyleOption();
|
|
1149
2975
|
node.classList.toggle("stream-monaco-unchanged-merged-secondary", shouldUseMergedSecondary);
|
|
1150
2976
|
node.classList.toggle("stream-monaco-unchanged-merged-primary", mergeRole === "primary");
|
|
1151
2977
|
const primary = node.children.item(0);
|
|
1152
2978
|
const meta = node.children.item(1);
|
|
1153
2979
|
if (primary instanceof HTMLElement) primary.classList.add("stream-monaco-unchanged-primary");
|
|
1154
2980
|
if (meta instanceof HTMLElement) {
|
|
2981
|
+
var _countSource$textCont;
|
|
1155
2982
|
meta.classList.add("stream-monaco-unchanged-meta");
|
|
1156
|
-
const
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
if (index === 0) child.classList.add("stream-monaco-unchanged-count");
|
|
1161
|
-
else if (child.classList.contains("breadcrumb-item")) child.classList.add("stream-monaco-unchanged-breadcrumb");
|
|
1162
|
-
else child.classList.add("stream-monaco-unchanged-separator");
|
|
1163
|
-
});
|
|
2983
|
+
const countSource = meta.querySelector(".count") ?? meta.firstElementChild;
|
|
2984
|
+
const countText = this.formatDiffUnchangedCountLabel((countSource === null || countSource === void 0 || (_countSource$textCont = countSource.textContent) === null || _countSource$textCont === void 0 ? void 0 : _countSource$textCont.trim()) || "Unmodified lines");
|
|
2985
|
+
const summaryLabel = unchangedRegionStyle === "metadata" ? this.resolveDiffMetadataLabel(node, pairIndex) ?? countText : countText;
|
|
2986
|
+
this.updateDiffUnchangedMetaNode(meta, unchangedRegionStyle, summaryLabel);
|
|
1164
2987
|
}
|
|
1165
2988
|
const action = node.querySelector("a");
|
|
1166
2989
|
if (action instanceof HTMLElement) {
|
|
1167
2990
|
action.classList.add("stream-monaco-unchanged-expand");
|
|
1168
2991
|
action.dataset.streamMonacoLabel = "Expand all";
|
|
1169
|
-
action.title = "Expand all
|
|
1170
|
-
action.setAttribute("aria-label", "Expand all
|
|
2992
|
+
action.title = "Expand all unmodified lines";
|
|
2993
|
+
action.setAttribute("aria-label", "Expand all unmodified lines");
|
|
1171
2994
|
action.toggleAttribute("aria-hidden", shouldUseMergedSecondary);
|
|
1172
2995
|
action.tabIndex = shouldUseMergedSecondary ? -1 : 0;
|
|
1173
2996
|
if (action.dataset.streamMonacoExpandPatched !== "true") {
|
|
1174
2997
|
action.dataset.streamMonacoExpandPatched = "true";
|
|
1175
2998
|
this.createDomDisposable(this.diffUnchangedRegionDisposables, action, "click", () => {
|
|
2999
|
+
this.hideAllDiffUnchangedBridgeEntries();
|
|
1176
3000
|
this.scheduleCapturePersistedDiffUnchangedState(1);
|
|
3001
|
+
this.schedulePatchDiffUnchangedRegionsAfterInteraction();
|
|
1177
3002
|
});
|
|
1178
3003
|
}
|
|
1179
3004
|
}
|
|
@@ -1190,83 +3015,100 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
1190
3015
|
const target = event.target instanceof HTMLElement ? event.target : null;
|
|
1191
3016
|
if (target === null || target === void 0 ? void 0 : target.closest("a, .breadcrumb-item")) return;
|
|
1192
3017
|
event.preventDefault();
|
|
3018
|
+
this.hideAllDiffUnchangedBridgeEntries();
|
|
1193
3019
|
activate();
|
|
1194
3020
|
this.scheduleCapturePersistedDiffUnchangedState(1);
|
|
3021
|
+
this.schedulePatchDiffUnchangedRegionsAfterInteraction();
|
|
1195
3022
|
});
|
|
1196
3023
|
}
|
|
1197
3024
|
}
|
|
1198
|
-
renderMergedDiffUnchangedBridge(secondaryNode, primaryNode) {
|
|
1199
|
-
var _countSource$
|
|
1200
|
-
if (!this.lastContainer) return;
|
|
3025
|
+
renderMergedDiffUnchangedBridge(secondaryNode, primaryNode, pairIndex, pairCount) {
|
|
3026
|
+
var _countSource$textCont2, _secondaryNode$closes;
|
|
3027
|
+
if (!this.lastContainer) return null;
|
|
1201
3028
|
const overlay = this.ensureDiffUnchangedBridgeOverlay();
|
|
1202
|
-
if (!overlay) return;
|
|
3029
|
+
if (!overlay) return null;
|
|
1203
3030
|
const containerRect = this.lastContainer.getBoundingClientRect();
|
|
1204
3031
|
const secondaryRect = secondaryNode.getBoundingClientRect();
|
|
1205
3032
|
const primaryRect = primaryNode.getBoundingClientRect();
|
|
1206
3033
|
const primaryStyle = globalThis.getComputedStyle(primaryNode);
|
|
1207
|
-
const primaryAction = primaryNode.querySelector(".stream-monaco-unchanged-expand");
|
|
1208
|
-
const primaryActionRect = primaryAction === null || primaryAction === void 0 ? void 0 : primaryAction.getBoundingClientRect();
|
|
1209
3034
|
const countSource = primaryNode.querySelector(".stream-monaco-unchanged-count") ?? secondaryNode.querySelector(".stream-monaco-unchanged-count");
|
|
1210
|
-
const countText = (countSource === null || countSource === void 0 || (_countSource$
|
|
3035
|
+
const countText = this.formatDiffUnchangedCountLabel((countSource === null || countSource === void 0 || (_countSource$textCont2 = countSource.textContent) === null || _countSource$textCont2 === void 0 ? void 0 : _countSource$textCont2.trim()) || "Unmodified lines");
|
|
3036
|
+
const unchangedRegionStyle = this.resolveDiffUnchangedRegionStyleOption();
|
|
3037
|
+
const metadataLabel = unchangedRegionStyle === "metadata" ? this.resolveDiffMetadataLabel(primaryNode, pairIndex) : null;
|
|
1211
3038
|
const editorSurface = primaryNode.closest(".monaco-editor") ?? primaryNode;
|
|
1212
3039
|
const editorSurfaceStyle = globalThis.getComputedStyle(editorSurface);
|
|
3040
|
+
const primaryHidden = primaryNode.parentElement;
|
|
3041
|
+
const secondaryHidden = secondaryNode.parentElement;
|
|
3042
|
+
const primaryWidget = primaryHidden === null || primaryHidden === void 0 ? void 0 : primaryHidden.parentElement;
|
|
3043
|
+
const secondaryWidget = secondaryHidden === null || secondaryHidden === void 0 ? void 0 : secondaryHidden.parentElement;
|
|
3044
|
+
const topHandle = (primaryHidden === null || primaryHidden === void 0 ? void 0 : primaryHidden.querySelector(".top")) ?? (secondaryHidden === null || secondaryHidden === void 0 ? void 0 : secondaryHidden.querySelector(".top"));
|
|
3045
|
+
const bottomHandle = (primaryHidden === null || primaryHidden === void 0 ? void 0 : primaryHidden.querySelector(".bottom")) ?? (secondaryHidden === null || secondaryHidden === void 0 ? void 0 : secondaryHidden.querySelector(".bottom"));
|
|
3046
|
+
const { showTopHandle, showBottomHandle } = this.resolveDiffUnchangedRevealLayout(primaryNode, countText, pairIndex, pairCount);
|
|
3047
|
+
const key = this.getDiffUnchangedBridgeKey(secondaryNode, primaryNode);
|
|
1213
3048
|
secondaryNode.classList.add("stream-monaco-unchanged-bridge-source");
|
|
1214
3049
|
primaryNode.classList.add("stream-monaco-unchanged-bridge-source");
|
|
1215
|
-
const
|
|
3050
|
+
const entry = this.acquireDiffUnchangedBridgeEntry(key);
|
|
3051
|
+
const { bridge, summary, divider } = entry;
|
|
1216
3052
|
bridge.className = "stream-monaco-diff-unchanged-bridge";
|
|
1217
|
-
bridge.
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
3053
|
+
bridge.classList.add(`stream-monaco-diff-unchanged-bridge-${unchangedRegionStyle}`);
|
|
3054
|
+
const secondaryAnchorRect = (secondaryWidget === null || secondaryWidget === void 0 ? void 0 : secondaryWidget.getBoundingClientRect()) ?? secondaryRect;
|
|
3055
|
+
const primaryAnchorRect = (primaryWidget === null || primaryWidget === void 0 ? void 0 : primaryWidget.getBoundingClientRect()) ?? primaryRect;
|
|
3056
|
+
const secondaryMargin = (_secondaryNode$closes = secondaryNode.closest(".monaco-editor")) === null || _secondaryNode$closes === void 0 ? void 0 : _secondaryNode$closes.querySelector(".margin");
|
|
3057
|
+
const secondaryMarginRect = secondaryMargin === null || secondaryMargin === void 0 ? void 0 : secondaryMargin.getBoundingClientRect();
|
|
3058
|
+
const lineInfoRailMetrics = unchangedRegionStyle === "line-info" ? this.resolveDiffUnchangedLineInfoRailMetrics(secondaryNode) : null;
|
|
3059
|
+
const bridgeLeftInset = (lineInfoRailMetrics === null || lineInfoRailMetrics === void 0 ? void 0 : lineInfoRailMetrics.leftInset) ?? 0;
|
|
3060
|
+
const bridgeRailWidth = (lineInfoRailMetrics === null || lineInfoRailMetrics === void 0 ? void 0 : lineInfoRailMetrics.width) ?? (secondaryMarginRect === null || secondaryMarginRect === void 0 ? void 0 : secondaryMarginRect.width) ?? null;
|
|
3061
|
+
bridge.style.left = `${secondaryAnchorRect.left - containerRect.left + this.lastContainer.scrollLeft + bridgeLeftInset}px`;
|
|
3062
|
+
bridge.style.top = `${primaryAnchorRect.top - containerRect.top + this.lastContainer.scrollTop}px`;
|
|
3063
|
+
bridge.style.width = `${Math.max(0, primaryAnchorRect.right - secondaryAnchorRect.left - bridgeLeftInset)}px`;
|
|
3064
|
+
bridge.style.height = `${Math.max(secondaryAnchorRect.height, primaryAnchorRect.height)}px`;
|
|
1225
3065
|
bridge.style.color = primaryStyle.color;
|
|
1226
3066
|
bridge.style.fontFamily = primaryStyle.fontFamily;
|
|
1227
3067
|
bridge.style.fontSize = primaryStyle.fontSize;
|
|
1228
3068
|
bridge.style.lineHeight = primaryStyle.lineHeight;
|
|
1229
3069
|
bridge.style.setProperty("--stream-monaco-unchanged-fg", primaryStyle.color);
|
|
1230
3070
|
bridge.style.setProperty("--stream-monaco-editor-bg", editorSurfaceStyle.backgroundColor);
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
3071
|
+
bridge.style.setProperty("--stream-monaco-unchanged-split-offset", `${Math.max(0, secondaryAnchorRect.width - bridgeLeftInset)}px`);
|
|
3072
|
+
if (bridgeRailWidth) bridge.style.setProperty("--stream-monaco-unchanged-rail-width", `${bridgeRailWidth}px`);
|
|
3073
|
+
else bridge.style.removeProperty("--stream-monaco-unchanged-rail-width");
|
|
3074
|
+
summary.classList.remove("stream-monaco-unchanged-summary-line-info", "stream-monaco-unchanged-summary-line-info-basic", "stream-monaco-unchanged-summary-metadata", "stream-monaco-unchanged-summary-simple");
|
|
3075
|
+
summary.classList.add(`stream-monaco-unchanged-summary-${unchangedRegionStyle}`);
|
|
3076
|
+
const summaryLabel = metadataLabel || countText;
|
|
3077
|
+
const summaryInteractive = unchangedRegionStyle === "line-info" || unchangedRegionStyle === "line-info-basic";
|
|
3078
|
+
summary.disabled = !summaryInteractive;
|
|
3079
|
+
summary.tabIndex = summaryInteractive ? 0 : -1;
|
|
3080
|
+
if (summaryInteractive) {
|
|
3081
|
+
summary.removeAttribute("aria-hidden");
|
|
3082
|
+
summary.setAttribute("aria-label", `${summaryLabel}. Expand all unmodified lines`);
|
|
3083
|
+
summary.title = "Expand all unmodified lines";
|
|
3084
|
+
} else if (unchangedRegionStyle === "simple") {
|
|
3085
|
+
summary.setAttribute("aria-hidden", "true");
|
|
3086
|
+
summary.removeAttribute("aria-label");
|
|
3087
|
+
summary.title = "";
|
|
3088
|
+
} else {
|
|
3089
|
+
summary.removeAttribute("aria-hidden");
|
|
3090
|
+
summary.removeAttribute("aria-label");
|
|
3091
|
+
summary.title = "";
|
|
3092
|
+
}
|
|
3093
|
+
this.updateDiffUnchangedBridgeMeta(entry, unchangedRegionStyle, summaryLabel);
|
|
3094
|
+
if (unchangedRegionStyle === "line-info" || unchangedRegionStyle === "line-info-basic") {
|
|
3095
|
+
this.syncDiffUnchangedBridgeRail(entry, showTopHandle, topHandle ?? null, showBottomHandle, bottomHandle ?? null);
|
|
3096
|
+
if (entry.rail && entry.rail.parentElement !== bridge) bridge.prepend(entry.rail);
|
|
3097
|
+
} else if (entry.rail) {
|
|
3098
|
+
entry.rail.hidden = true;
|
|
3099
|
+
entry.rail.setAttribute("aria-hidden", "true");
|
|
3100
|
+
}
|
|
3101
|
+
entry.activate = () => {
|
|
1252
3102
|
const action = primaryNode.querySelector("a, button") ?? secondaryNode.querySelector("a, button");
|
|
1253
3103
|
if (action instanceof HTMLElement) {
|
|
1254
3104
|
action.click();
|
|
1255
3105
|
this.scheduleCapturePersistedDiffUnchangedState(1);
|
|
1256
3106
|
}
|
|
1257
3107
|
};
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
activate();
|
|
1263
|
-
});
|
|
1264
|
-
this.createDomDisposable(this.diffUnchangedBridgeDisposables, bridge, "keydown", (event) => {
|
|
1265
|
-
const keyboardEvent = event;
|
|
1266
|
-
if (keyboardEvent.key !== "Enter" && keyboardEvent.key !== " ") return;
|
|
1267
|
-
keyboardEvent.preventDefault();
|
|
1268
|
-
activate();
|
|
1269
|
-
});
|
|
3108
|
+
if (summary.parentElement !== bridge) bridge.append(summary);
|
|
3109
|
+
if (divider.parentElement !== bridge) bridge.append(divider);
|
|
3110
|
+
if (bridge.parentElement !== overlay) overlay.append(bridge);
|
|
3111
|
+
return key;
|
|
1270
3112
|
}
|
|
1271
3113
|
patchDiffUnchangedFoldGlyph(node) {
|
|
1272
3114
|
if (node.dataset.streamMonacoFoldGlyphPatched === "true") return;
|
|
@@ -1287,8 +3129,10 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
1287
3129
|
}
|
|
1288
3130
|
scanAndPatchDiffUnchangedRegions() {
|
|
1289
3131
|
if (!this.lastContainer) return;
|
|
3132
|
+
this.applyDiffRootAppearanceClass();
|
|
3133
|
+
const viewZoneHeightsChanged = this.syncDiffUnchangedViewZoneHeights();
|
|
1290
3134
|
const centers = this.lastContainer.querySelectorAll(".diff-hidden-lines .center");
|
|
1291
|
-
centers.forEach((node) => this.patchDiffUnchangedCenter(node));
|
|
3135
|
+
Array.from(centers).sort((a, b) => a.getBoundingClientRect().top - b.getBoundingClientRect().top).forEach((node, index) => this.patchDiffUnchangedCenter(node, index));
|
|
1292
3136
|
const partialRevealHandles = this.lastContainer.querySelectorAll(".diff-hidden-lines .top, .diff-hidden-lines .bottom");
|
|
1293
3137
|
partialRevealHandles.forEach((node) => {
|
|
1294
3138
|
node.removeAttribute("title");
|
|
@@ -1296,25 +3140,34 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
1296
3140
|
node.removeAttribute("role");
|
|
1297
3141
|
node.removeAttribute("tabindex");
|
|
1298
3142
|
});
|
|
1299
|
-
this.
|
|
3143
|
+
this.clearDiffUnchangedBridgeSources();
|
|
1300
3144
|
const secondaryCenters = Array.from(centers).filter((node) => node.classList.contains("stream-monaco-unchanged-merged-secondary")).sort((a, b) => a.getBoundingClientRect().top - b.getBoundingClientRect().top);
|
|
1301
3145
|
const primaryCenters = Array.from(centers).filter((node) => node.classList.contains("stream-monaco-unchanged-merged-primary")).sort((a, b) => a.getBoundingClientRect().top - b.getBoundingClientRect().top);
|
|
1302
3146
|
const pairCount = Math.min(secondaryCenters.length, primaryCenters.length);
|
|
3147
|
+
const visibleKeys = /* @__PURE__ */ new Set();
|
|
1303
3148
|
for (let i = 0; i < pairCount; i++) {
|
|
1304
3149
|
const secondaryNode = secondaryCenters[i];
|
|
1305
3150
|
const primaryNode = primaryCenters[i];
|
|
1306
3151
|
const topDelta = Math.abs(secondaryNode.getBoundingClientRect().top - primaryNode.getBoundingClientRect().top);
|
|
1307
3152
|
if (topDelta > 6) continue;
|
|
1308
|
-
this.renderMergedDiffUnchangedBridge(secondaryNode, primaryNode);
|
|
3153
|
+
const key = this.renderMergedDiffUnchangedBridge(secondaryNode, primaryNode, i, pairCount);
|
|
3154
|
+
if (key) visibleKeys.add(key);
|
|
1309
3155
|
}
|
|
3156
|
+
this.pruneDiffUnchangedBridgeEntries(visibleKeys);
|
|
3157
|
+
this.syncDiffUnchangedOverlayScrollBaseline();
|
|
1310
3158
|
const foldGlyphs = this.lastContainer.querySelectorAll(".fold-unchanged");
|
|
1311
3159
|
foldGlyphs.forEach((node) => this.patchDiffUnchangedFoldGlyph(node));
|
|
3160
|
+
if (viewZoneHeightsChanged) this.schedulePatchDiffUnchangedRegions();
|
|
1312
3161
|
}
|
|
1313
3162
|
schedulePatchDiffUnchangedRegions() {
|
|
1314
3163
|
this.rafScheduler.schedule("patch-diff-unchanged-regions", () => {
|
|
1315
3164
|
this.scanAndPatchDiffUnchangedRegions();
|
|
1316
3165
|
});
|
|
1317
3166
|
}
|
|
3167
|
+
schedulePatchDiffUnchangedRegionsAfterScroll() {
|
|
3168
|
+
this.applyDiffUnchangedOverlayScrollCompensation();
|
|
3169
|
+
this.schedulePatchDiffUnchangedRegions();
|
|
3170
|
+
}
|
|
1318
3171
|
setupDiffUnchangedRegionEnhancements() {
|
|
1319
3172
|
var _globalThis$getComput, _globalThis;
|
|
1320
3173
|
this.disposeDiffUnchangedRegionEnhancements();
|
|
@@ -1323,14 +3176,14 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
1323
3176
|
this.ensureDiffUiStyle();
|
|
1324
3177
|
const containerStyle = (_globalThis$getComput = (_globalThis = globalThis).getComputedStyle) === null || _globalThis$getComput === void 0 ? void 0 : _globalThis$getComput.call(_globalThis, this.lastContainer);
|
|
1325
3178
|
if (!containerStyle || containerStyle.position === "static") this.lastContainer.style.position = "relative";
|
|
1326
|
-
this.
|
|
3179
|
+
this.applyDiffRootAppearanceClass();
|
|
1327
3180
|
this.schedulePatchDiffUnchangedRegions();
|
|
1328
3181
|
if (typeof MutationObserver !== "undefined") {
|
|
1329
3182
|
this.diffUnchangedRegionObserver = new MutationObserver((mutations) => {
|
|
1330
3183
|
const shouldRepatch = mutations.some((mutation) => {
|
|
1331
3184
|
const target = mutation.target instanceof HTMLElement ? mutation.target : null;
|
|
1332
3185
|
if (target === null || target === void 0 ? void 0 : target.closest(".stream-monaco-diff-unchanged-overlay")) return false;
|
|
1333
|
-
const changedNodes =
|
|
3186
|
+
const changedNodes = Array.from(mutation.addedNodes).concat(Array.from(mutation.removedNodes));
|
|
1334
3187
|
if (changedNodes.length > 0 && changedNodes.every((node) => {
|
|
1335
3188
|
return node instanceof HTMLElement && node.classList.contains("stream-monaco-diff-unchanged-overlay");
|
|
1336
3189
|
})) return false;
|
|
@@ -1345,15 +3198,19 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
1345
3198
|
}
|
|
1346
3199
|
const originalEditor = this.diffEditorView.getOriginalEditor();
|
|
1347
3200
|
const modifiedEditor = this.diffEditorView.getModifiedEditor();
|
|
1348
|
-
const repatch = () =>
|
|
3201
|
+
const repatch = () => {
|
|
3202
|
+
this.applyDiffRootAppearanceClass();
|
|
3203
|
+
this.schedulePatchDiffUnchangedRegions();
|
|
3204
|
+
};
|
|
1349
3205
|
this.diffUnchangedRegionDisposables.push(this.diffEditorView.onDidUpdateDiff(() => {
|
|
1350
3206
|
repatch();
|
|
1351
3207
|
this.scheduleRestorePersistedDiffUnchangedState();
|
|
1352
3208
|
}));
|
|
1353
3209
|
this.diffUnchangedRegionDisposables.push(originalEditor.onDidLayoutChange(repatch));
|
|
1354
3210
|
this.diffUnchangedRegionDisposables.push(modifiedEditor.onDidLayoutChange(repatch));
|
|
1355
|
-
this.diffUnchangedRegionDisposables.push(originalEditor.onDidScrollChange(
|
|
1356
|
-
this.diffUnchangedRegionDisposables.push(modifiedEditor.onDidScrollChange(
|
|
3211
|
+
this.diffUnchangedRegionDisposables.push(originalEditor.onDidScrollChange(() => this.schedulePatchDiffUnchangedRegionsAfterScroll()));
|
|
3212
|
+
this.diffUnchangedRegionDisposables.push(modifiedEditor.onDidScrollChange(() => this.schedulePatchDiffUnchangedRegionsAfterScroll()));
|
|
3213
|
+
this.createDomDisposable(this.diffUnchangedRegionDisposables, this.lastContainer, "scroll", () => this.schedulePatchDiffUnchangedRegionsAfterScroll());
|
|
1357
3214
|
}
|
|
1358
3215
|
setupDiffHunkInteractions() {
|
|
1359
3216
|
var _globalThis$getComput2, _globalThis2;
|
|
@@ -1379,11 +3236,15 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
1379
3236
|
}));
|
|
1380
3237
|
this.diffHunkDisposables.push(editor.onMouseLeave(() => this.scheduleHideDiffHunkActions()));
|
|
1381
3238
|
this.diffHunkDisposables.push(editor.onDidScrollChange(() => this.repositionDiffHunkNodes()));
|
|
1382
|
-
this.diffHunkDisposables.push(editor.onDidLayoutChange(() =>
|
|
3239
|
+
this.diffHunkDisposables.push(editor.onDidLayoutChange(() => {
|
|
3240
|
+
this.applyDiffRootAppearanceClass();
|
|
3241
|
+
this.repositionDiffHunkNodes();
|
|
3242
|
+
}));
|
|
1383
3243
|
};
|
|
1384
3244
|
bindHover(originalEditor, "original");
|
|
1385
3245
|
bindHover(modifiedEditor, "modified");
|
|
1386
3246
|
this.diffHunkDisposables.push(this.diffEditorView.onDidUpdateDiff(() => {
|
|
3247
|
+
this.applyDiffRootAppearanceClass();
|
|
1387
3248
|
this.diffHunkLineChanges = this.getEffectiveLineChanges();
|
|
1388
3249
|
if (this.diffHunkActiveChange) this.hideDiffHunkActions();
|
|
1389
3250
|
}));
|
|
@@ -1404,9 +3265,21 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
1404
3265
|
}
|
|
1405
3266
|
hideDiffHunkActions() {
|
|
1406
3267
|
this.diffHunkActiveChange = null;
|
|
3268
|
+
this.diffHunkActiveHoverSide = null;
|
|
1407
3269
|
if (this.diffHunkUpperNode) this.diffHunkUpperNode.style.display = "none";
|
|
1408
3270
|
if (this.diffHunkLowerNode) this.diffHunkLowerNode.style.display = "none";
|
|
1409
3271
|
}
|
|
3272
|
+
inferInlineDiffHunkHoverSide(change, event) {
|
|
3273
|
+
var _event$target$positio;
|
|
3274
|
+
const targetElement = event.target.element instanceof HTMLElement ? event.target.element : null;
|
|
3275
|
+
if (targetElement === null || targetElement === void 0 ? void 0 : targetElement.closest(".line-delete, .char-delete, .inline-deleted-text, .inline-deleted-margin-view-zone")) return "upper";
|
|
3276
|
+
if (targetElement === null || targetElement === void 0 ? void 0 : targetElement.closest(".line-insert, .char-insert, .gutter-insert, .view-line")) return "lower";
|
|
3277
|
+
if (!this.hasModifiedLines(change)) return "upper";
|
|
3278
|
+
if (!this.hasOriginalLines(change)) return "lower";
|
|
3279
|
+
const hoverLine = ((_event$target$positio = event.target.position) === null || _event$target$positio === void 0 ? void 0 : _event$target$positio.lineNumber) ?? 0;
|
|
3280
|
+
const modifiedAnchor = Math.max(1, change.modifiedStartLineNumber || change.modifiedEndLineNumber || 1);
|
|
3281
|
+
return hoverLine < modifiedAnchor ? "upper" : "lower";
|
|
3282
|
+
}
|
|
1410
3283
|
hasOriginalLines(change) {
|
|
1411
3284
|
return change.originalStartLineNumber > 0 && change.originalEndLineNumber >= change.originalStartLineNumber;
|
|
1412
3285
|
}
|
|
@@ -1441,8 +3314,8 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
1441
3314
|
return best;
|
|
1442
3315
|
}
|
|
1443
3316
|
handleDiffHunkMouseMove(side, event) {
|
|
1444
|
-
var _event$target$
|
|
1445
|
-
const line = (_event$target$
|
|
3317
|
+
var _event$target$positio2;
|
|
3318
|
+
const line = (_event$target$positio2 = event.target.position) === null || _event$target$positio2 === void 0 ? void 0 : _event$target$positio2.lineNumber;
|
|
1446
3319
|
if (!line) {
|
|
1447
3320
|
this.scheduleHideDiffHunkActions(120);
|
|
1448
3321
|
return;
|
|
@@ -1454,6 +3327,7 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
1454
3327
|
}
|
|
1455
3328
|
this.cancelScheduledHideDiffHunkActions();
|
|
1456
3329
|
this.diffHunkActiveChange = change;
|
|
3330
|
+
this.diffHunkActiveHoverSide = this.isDiffInlineMode() ? this.inferInlineDiffHunkHoverSide(change, event) : null;
|
|
1457
3331
|
this.repositionDiffHunkNodes();
|
|
1458
3332
|
}
|
|
1459
3333
|
isOriginalEditorCollapsed() {
|
|
@@ -1462,6 +3336,12 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
1462
3336
|
const info = (_this$diffEditorView$3 = (_this$diffEditorView$4 = this.diffEditorView.getOriginalEditor()).getLayoutInfo) === null || _this$diffEditorView$3 === void 0 ? void 0 : _this$diffEditorView$3.call(_this$diffEditorView$4);
|
|
1463
3337
|
return !info || info.width < 24;
|
|
1464
3338
|
}
|
|
3339
|
+
isDiffInlineMode() {
|
|
3340
|
+
var _this$lastContainer;
|
|
3341
|
+
const diffRoot = (_this$lastContainer = this.lastContainer) === null || _this$lastContainer === void 0 ? void 0 : _this$lastContainer.querySelector(".monaco-diff-editor");
|
|
3342
|
+
if (diffRoot instanceof HTMLElement) return !diffRoot.classList.contains("side-by-side");
|
|
3343
|
+
return this.isOriginalEditorCollapsed();
|
|
3344
|
+
}
|
|
1465
3345
|
getEditorBySide(side) {
|
|
1466
3346
|
if (!this.diffEditorView) return null;
|
|
1467
3347
|
return side === "original" ? this.diffEditorView.getOriginalEditor() : this.diffEditorView.getModifiedEditor();
|
|
@@ -1496,8 +3376,37 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
1496
3376
|
const lastColumn = model.getLineMaxColumn(lastLine);
|
|
1497
3377
|
return new monaco_shim_exports.Range(lastLine, lastColumn, lastLine, lastColumn);
|
|
1498
3378
|
}
|
|
3379
|
+
applyDiffModelLanguage(models, codeLanguage) {
|
|
3380
|
+
if (!codeLanguage) return;
|
|
3381
|
+
const lang = processedLanguage(codeLanguage);
|
|
3382
|
+
if (!lang) return;
|
|
3383
|
+
if (models.original.getLanguageId() !== lang) monaco_shim_exports.editor.setModelLanguage(models.original, lang);
|
|
3384
|
+
if (models.modified.getLanguageId() !== lang) monaco_shim_exports.editor.setModelLanguage(models.modified, lang);
|
|
3385
|
+
}
|
|
3386
|
+
restoreDiffViewState(viewState) {
|
|
3387
|
+
if (!this.diffEditorView || !viewState) return;
|
|
3388
|
+
const restore = () => {
|
|
3389
|
+
try {
|
|
3390
|
+
var _this$diffEditorView25;
|
|
3391
|
+
(_this$diffEditorView25 = this.diffEditorView) === null || _this$diffEditorView25 === void 0 || _this$diffEditorView25.restoreViewState(viewState);
|
|
3392
|
+
} catch {}
|
|
3393
|
+
};
|
|
3394
|
+
restore();
|
|
3395
|
+
requestAnimationFrame(restore);
|
|
3396
|
+
}
|
|
3397
|
+
disposePreviousDiffModel(model, owned, nextModel) {
|
|
3398
|
+
if (!model || !owned || model === nextModel) return;
|
|
3399
|
+
model.dispose();
|
|
3400
|
+
}
|
|
3401
|
+
disposePendingPreparedDiffViewModel() {
|
|
3402
|
+
if (!this.pendingPreparedDiffViewModel) return;
|
|
3403
|
+
try {
|
|
3404
|
+
this.pendingPreparedDiffViewModel.dispose();
|
|
3405
|
+
} catch {}
|
|
3406
|
+
this.pendingPreparedDiffViewModel = null;
|
|
3407
|
+
}
|
|
1499
3408
|
syncDiffKnownValues() {
|
|
1500
|
-
var _this$
|
|
3409
|
+
var _this$diffEditorView26, _this$diffEditorView27, _this$diffEditorView28, _this$diffHeightManag2;
|
|
1501
3410
|
if (this.originalModel) this.lastKnownOriginalCode = this.originalModel.getValue();
|
|
1502
3411
|
if (this.modifiedModel) {
|
|
1503
3412
|
this.lastKnownModifiedCode = this.modifiedModel.getValue();
|
|
@@ -1506,8 +3415,8 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
1506
3415
|
this.lastKnownModifiedDirty = false;
|
|
1507
3416
|
this._hasScrollBar = false;
|
|
1508
3417
|
this.cachedComputedHeightDiff = this.computedHeight();
|
|
1509
|
-
this.cachedScrollHeightDiff = ((_this$
|
|
1510
|
-
(_this$
|
|
3418
|
+
this.cachedScrollHeightDiff = ((_this$diffEditorView26 = this.diffEditorView) === null || _this$diffEditorView26 === void 0 || (_this$diffEditorView28 = (_this$diffEditorView27 = _this$diffEditorView26.getModifiedEditor()).getScrollHeight) === null || _this$diffEditorView28 === void 0 ? void 0 : _this$diffEditorView28.call(_this$diffEditorView27)) ?? this.cachedScrollHeightDiff;
|
|
3419
|
+
(_this$diffHeightManag2 = this.diffHeightManager) === null || _this$diffHeightManag2 === void 0 || _this$diffHeightManag2.update();
|
|
1511
3420
|
}
|
|
1512
3421
|
applyDefaultDiffHunkAction(context) {
|
|
1513
3422
|
const { action, side, lineChange } = context;
|
|
@@ -1518,8 +3427,7 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
1518
3427
|
if (!hasOriginal) return;
|
|
1519
3428
|
const text = this.getLinesText(this.originalModel, lineChange.originalStartLineNumber, lineChange.originalEndLineNumber);
|
|
1520
3429
|
if (!text) return;
|
|
1521
|
-
const
|
|
1522
|
-
const range = this.getInsertRangeBeforeLine(this.modifiedModel, anchor);
|
|
3430
|
+
const range = hasModified ? this.getInsertRangeBeforeLine(this.modifiedModel, lineChange.modifiedStartLineNumber) : this.getInsertRangeAfterLine(this.modifiedModel, Math.max(0, lineChange.modifiedStartLineNumber || lineChange.modifiedEndLineNumber));
|
|
1523
3431
|
this.modifiedModel.applyEdits([{
|
|
1524
3432
|
range,
|
|
1525
3433
|
text,
|
|
@@ -1553,7 +3461,7 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
1553
3461
|
if (!hasModified) return;
|
|
1554
3462
|
const text = this.getLinesText(this.modifiedModel, lineChange.modifiedStartLineNumber, lineChange.modifiedEndLineNumber);
|
|
1555
3463
|
if (!text) return;
|
|
1556
|
-
const anchor = hasOriginal ? lineChange.originalEndLineNumber : Math.max(0, lineChange.originalStartLineNumber
|
|
3464
|
+
const anchor = hasOriginal ? lineChange.originalEndLineNumber : Math.max(0, lineChange.originalStartLineNumber);
|
|
1557
3465
|
const range = this.getInsertRangeAfterLine(this.originalModel, anchor);
|
|
1558
3466
|
this.originalModel.applyEdits([{
|
|
1559
3467
|
range,
|
|
@@ -1562,26 +3470,34 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
1562
3470
|
}]);
|
|
1563
3471
|
}
|
|
1564
3472
|
}
|
|
1565
|
-
applyDiffHunkAction(side, action) {
|
|
3473
|
+
async applyDiffHunkAction(side, action) {
|
|
1566
3474
|
if (!this.diffHunkActiveChange || !this.originalModel || !this.modifiedModel) return;
|
|
1567
|
-
this.
|
|
1568
|
-
this.
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
3475
|
+
if (this.diffHunkActionInFlight) return;
|
|
3476
|
+
this.diffHunkActionInFlight = true;
|
|
3477
|
+
this.setDiffHunkNodeEnabled(this.diffHunkUpperNode, false);
|
|
3478
|
+
this.setDiffHunkNodeEnabled(this.diffHunkLowerNode, false);
|
|
3479
|
+
try {
|
|
3480
|
+
this.flushOriginalAppendBufferSync();
|
|
3481
|
+
this.flushModifiedAppendBufferSync();
|
|
3482
|
+
const context = {
|
|
3483
|
+
action,
|
|
3484
|
+
side,
|
|
3485
|
+
lineChange: this.diffHunkActiveChange,
|
|
3486
|
+
originalModel: this.originalModel,
|
|
3487
|
+
modifiedModel: this.modifiedModel
|
|
3488
|
+
};
|
|
3489
|
+
let allowDefault = true;
|
|
3490
|
+
if (typeof this.options.onDiffHunkAction === "function") try {
|
|
3491
|
+
allowDefault = await this.options.onDiffHunkAction(context) !== false;
|
|
3492
|
+
} catch (error$1) {
|
|
3493
|
+
console.warn("onDiffHunkAction callback threw an error:", error$1);
|
|
3494
|
+
}
|
|
3495
|
+
if (allowDefault) this.applyDefaultDiffHunkAction(context);
|
|
3496
|
+
this.syncDiffKnownValues();
|
|
3497
|
+
this.hideDiffHunkActions();
|
|
3498
|
+
} finally {
|
|
3499
|
+
this.diffHunkActionInFlight = false;
|
|
3500
|
+
}
|
|
1585
3501
|
}
|
|
1586
3502
|
setDiffHunkNodeEnabled(node, enabled) {
|
|
1587
3503
|
if (!node) return;
|
|
@@ -1591,13 +3507,13 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
1591
3507
|
});
|
|
1592
3508
|
}
|
|
1593
3509
|
positionDiffHunkNode(node, side, anchorLine, extraOffsetY = 0) {
|
|
1594
|
-
var _editor$
|
|
3510
|
+
var _editor$getScrollTop2;
|
|
1595
3511
|
if (!this.diffHunkOverlay) return;
|
|
1596
3512
|
const editor = this.getEditorBySide(side);
|
|
1597
3513
|
if (!editor) return;
|
|
1598
3514
|
const host = editor.getContainerDomNode();
|
|
1599
3515
|
const line = Math.max(1, anchorLine);
|
|
1600
|
-
const rawTop = editor.getTopForLineNumber(line) - (((_editor$
|
|
3516
|
+
const rawTop = editor.getTopForLineNumber(line) - (((_editor$getScrollTop2 = editor.getScrollTop) === null || _editor$getScrollTop2 === void 0 ? void 0 : _editor$getScrollTop2.call(editor)) ?? 0);
|
|
1601
3517
|
const lineHeight = editor.getOption(monaco_shim_exports.editor.EditorOption.lineHeight);
|
|
1602
3518
|
const nodeWidth = node.offsetWidth || 130;
|
|
1603
3519
|
const nodeHeight = node.offsetHeight || 30;
|
|
@@ -1621,16 +3537,32 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
1621
3537
|
const hasModified = this.hasModifiedLines(change);
|
|
1622
3538
|
this.setDiffHunkNodeEnabled(this.diffHunkUpperNode, hasOriginal);
|
|
1623
3539
|
this.setDiffHunkNodeEnabled(this.diffHunkLowerNode, hasModified);
|
|
1624
|
-
const
|
|
3540
|
+
const inlineMode = this.isDiffInlineMode();
|
|
3541
|
+
if (inlineMode) {
|
|
3542
|
+
const inlineHoverSide = this.diffHunkActiveHoverSide ?? (hasOriginal && !hasModified ? "upper" : "lower");
|
|
3543
|
+
if (inlineHoverSide === "upper" && hasOriginal) {
|
|
3544
|
+
const upperAnchor = Math.max(1, change.modifiedStartLineNumber - 1 || change.modifiedEndLineNumber || 1);
|
|
3545
|
+
this.positionDiffHunkNode(this.diffHunkUpperNode, "modified", upperAnchor);
|
|
3546
|
+
this.diffHunkLowerNode.style.display = "none";
|
|
3547
|
+
return;
|
|
3548
|
+
}
|
|
3549
|
+
if (hasModified) {
|
|
3550
|
+
const lowerAnchor = Math.max(1, change.modifiedStartLineNumber || change.modifiedEndLineNumber || 1);
|
|
3551
|
+
this.positionDiffHunkNode(this.diffHunkLowerNode, "modified", lowerAnchor);
|
|
3552
|
+
this.diffHunkUpperNode.style.display = "none";
|
|
3553
|
+
return;
|
|
3554
|
+
}
|
|
3555
|
+
this.hideDiffHunkActions();
|
|
3556
|
+
return;
|
|
3557
|
+
}
|
|
1625
3558
|
if (hasOriginal) {
|
|
1626
|
-
const upperSide =
|
|
1627
|
-
const upperAnchor =
|
|
3559
|
+
const upperSide = "original";
|
|
3560
|
+
const upperAnchor = change.originalStartLineNumber;
|
|
1628
3561
|
this.positionDiffHunkNode(this.diffHunkUpperNode, upperSide, upperAnchor);
|
|
1629
3562
|
} else this.diffHunkUpperNode.style.display = "none";
|
|
1630
3563
|
if (hasModified) {
|
|
1631
|
-
const samePane = originalCollapsed;
|
|
1632
3564
|
const lowerAnchor = change.modifiedStartLineNumber;
|
|
1633
|
-
this.positionDiffHunkNode(this.diffHunkLowerNode, "modified", lowerAnchor
|
|
3565
|
+
this.positionDiffHunkNode(this.diffHunkLowerNode, "modified", lowerAnchor);
|
|
1634
3566
|
} else this.diffHunkLowerNode.style.display = "none";
|
|
1635
3567
|
}
|
|
1636
3568
|
scheduleFlushAppendBufferDiff() {
|
|
@@ -1668,7 +3600,7 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
1668
3600
|
this.appendToModel(this.originalModel, text);
|
|
1669
3601
|
}
|
|
1670
3602
|
computedHeight() {
|
|
1671
|
-
var _originalEditor$getMo, _modifiedEditor$getMo, _originalEditor$
|
|
3603
|
+
var _originalEditor$getMo, _modifiedEditor$getMo, _originalEditor$getSc5, _modifiedEditor$getSc10;
|
|
1672
3604
|
if (!this.diffEditorView) return Math.min(1 * 18 + padding, this.maxHeightValue);
|
|
1673
3605
|
const modifiedEditor = this.diffEditorView.getModifiedEditor();
|
|
1674
3606
|
const originalEditor = this.diffEditorView.getOriginalEditor();
|
|
@@ -1677,15 +3609,16 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
1677
3609
|
const mCount = ((_modifiedEditor$getMo = modifiedEditor.getModel()) === null || _modifiedEditor$getMo === void 0 ? void 0 : _modifiedEditor$getMo.getLineCount()) ?? 1;
|
|
1678
3610
|
const lineCount = Math.max(oCount, mCount);
|
|
1679
3611
|
const fromLines = lineCount * lineHeight + padding;
|
|
1680
|
-
const scrollH = Math.max(((_originalEditor$
|
|
3612
|
+
const scrollH = Math.max(((_originalEditor$getSc5 = originalEditor.getScrollHeight) === null || _originalEditor$getSc5 === void 0 ? void 0 : _originalEditor$getSc5.call(originalEditor)) ?? 0, ((_modifiedEditor$getSc10 = modifiedEditor.getScrollHeight) === null || _modifiedEditor$getSc10 === void 0 ? void 0 : _modifiedEditor$getSc10.call(modifiedEditor)) ?? 0);
|
|
1681
3613
|
const desired = Math.max(fromLines, scrollH);
|
|
1682
3614
|
return Math.min(desired, this.maxHeightValue);
|
|
1683
3615
|
}
|
|
1684
3616
|
isOverflowAutoDiff() {
|
|
1685
|
-
|
|
3617
|
+
if (!this.lastContainer) return false;
|
|
3618
|
+
return this.computedHeight() >= this.maxHeightValue - 1;
|
|
1686
3619
|
}
|
|
1687
3620
|
shouldPerformImmediateRevealDiff() {
|
|
1688
|
-
return this.autoScrollOnUpdate && this.shouldAutoScrollDiff && this.hasVerticalScrollbarModified() && this.isOverflowAutoDiff();
|
|
3621
|
+
return this.autoScrollOnUpdate && this.shouldAutoScrollDiff && !this.diffHideUnchangedRegionsDeferred && this.hasVerticalScrollbarModified() && this.isOverflowAutoDiff();
|
|
1689
3622
|
}
|
|
1690
3623
|
suppressScrollWatcherDiff(ms) {
|
|
1691
3624
|
if (!this.diffScrollWatcher || typeof this.diffScrollWatcher.setSuppressed !== "function") return;
|
|
@@ -1806,9 +3739,9 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
1806
3739
|
ticket,
|
|
1807
3740
|
line
|
|
1808
3741
|
});
|
|
1809
|
-
const strategy = this.revealStrategyOption ?? this.options.revealStrategy ?? "centerIfOutside";
|
|
3742
|
+
const strategy = this.diffHideUnchangedRegionsDeferred ? "bottom" : this.revealStrategyOption ?? this.options.revealStrategy ?? "centerIfOutside";
|
|
1810
3743
|
const ScrollType = monaco_shim_exports.ScrollType || ((_editor = monaco_shim_exports.editor) === null || _editor === void 0 ? void 0 : _editor.ScrollType);
|
|
1811
|
-
const smooth = ScrollType && typeof ScrollType.Smooth !== "undefined" ? ScrollType.Smooth : void 0;
|
|
3744
|
+
const smooth = !this.diffHideUnchangedRegionsDeferred && ScrollType && typeof ScrollType.Smooth !== "undefined" ? ScrollType.Smooth : void 0;
|
|
1812
3745
|
try {
|
|
1813
3746
|
const me = this.diffEditorView.getModifiedEditor();
|
|
1814
3747
|
if (strategy === "bottom") if (typeof smooth !== "undefined") me.revealLine(line, smooth);
|
|
@@ -1828,9 +3761,9 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
1828
3761
|
lastRevealLineDiff: this.lastRevealLineDiff
|
|
1829
3762
|
});
|
|
1830
3763
|
try {
|
|
1831
|
-
var _this$
|
|
3764
|
+
var _this$diffEditorView29, _this$diffEditorView30, _this$diffEditorView31;
|
|
1832
3765
|
this.shouldAutoScrollDiff = true;
|
|
1833
|
-
this.lastScrollTopDiff = ((_this$
|
|
3766
|
+
this.lastScrollTopDiff = ((_this$diffEditorView29 = this.diffEditorView) === null || _this$diffEditorView29 === void 0 || (_this$diffEditorView31 = (_this$diffEditorView30 = _this$diffEditorView29.getModifiedEditor()).getScrollTop) === null || _this$diffEditorView31 === void 0 ? void 0 : _this$diffEditorView31.call(_this$diffEditorView30)) ?? this.lastScrollTopDiff;
|
|
1834
3767
|
} catch {}
|
|
1835
3768
|
});
|
|
1836
3769
|
}
|
|
@@ -1849,9 +3782,9 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
1849
3782
|
ticket
|
|
1850
3783
|
});
|
|
1851
3784
|
try {
|
|
1852
|
-
var _this$
|
|
3785
|
+
var _this$diffEditorView32, _this$diffEditorView33, _this$diffEditorView34;
|
|
1853
3786
|
this.shouldAutoScrollDiff = true;
|
|
1854
|
-
this.lastScrollTopDiff = ((_this$
|
|
3787
|
+
this.lastScrollTopDiff = ((_this$diffEditorView32 = this.diffEditorView) === null || _this$diffEditorView32 === void 0 || (_this$diffEditorView34 = (_this$diffEditorView33 = _this$diffEditorView32.getModifiedEditor()).getScrollTop) === null || _this$diffEditorView34 === void 0 ? void 0 : _this$diffEditorView34.call(_this$diffEditorView33)) ?? this.lastScrollTopDiff;
|
|
1855
3788
|
} catch {}
|
|
1856
3789
|
}
|
|
1857
3790
|
scheduleImmediateRevealAfterLayoutDiff(line) {
|
|
@@ -1892,7 +3825,11 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
1892
3825
|
const lang = processedLanguage(language) || language;
|
|
1893
3826
|
this.originalModel = monaco_shim_exports.editor.createModel(originalCode, lang);
|
|
1894
3827
|
this.modifiedModel = monaco_shim_exports.editor.createModel(modifiedCode, lang);
|
|
3828
|
+
this.originalModelOwned = true;
|
|
3829
|
+
this.modifiedModelOwned = true;
|
|
1895
3830
|
const hideUnchangedRegions = this.resolveDiffHideUnchangedRegionsOption();
|
|
3831
|
+
this.diffHideUnchangedRegionsResolved = hideUnchangedRegions;
|
|
3832
|
+
this.diffHideUnchangedRegionsDeferred = false;
|
|
1896
3833
|
this.diffEditorView = monaco_shim_exports.editor.createDiffEditor(container, {
|
|
1897
3834
|
automaticLayout: true,
|
|
1898
3835
|
scrollBeyondLastLine: false,
|
|
@@ -1916,7 +3853,7 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
1916
3853
|
});
|
|
1917
3854
|
this.lastKnownOriginalCode = originalCode;
|
|
1918
3855
|
this.lastKnownModifiedCode = modifiedCode;
|
|
1919
|
-
this.diffUpdateThrottleMs = this.
|
|
3856
|
+
this.diffUpdateThrottleMs = this.resolveDiffStreamingThrottleMs();
|
|
1920
3857
|
this.shouldAutoScrollDiff = !!(this.autoScrollInitial && this.diffAutoScroll);
|
|
1921
3858
|
if (this.diffScrollWatcher) {
|
|
1922
3859
|
this.diffScrollWatcher.dispose();
|
|
@@ -1952,35 +3889,40 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
1952
3889
|
this.diffHeightManager = createHeightManager(container, () => this.computedHeight());
|
|
1953
3890
|
this.diffHeightManager.update();
|
|
1954
3891
|
const initialComputed = this.computedHeight();
|
|
1955
|
-
if (initialComputed >= this.maxHeightValue - 1) {
|
|
1956
|
-
container.style.height = `${this.maxHeightValue}px`;
|
|
1957
|
-
container.style.overflow = "auto";
|
|
1958
|
-
}
|
|
3892
|
+
if (initialComputed >= this.maxHeightValue - 1) container.style.height = `${this.maxHeightValue}px`;
|
|
1959
3893
|
const me = this.diffEditorView.getModifiedEditor();
|
|
1960
3894
|
this.cachedScrollHeightDiff = ((_me$getScrollHeight2 = me.getScrollHeight) === null || _me$getScrollHeight2 === void 0 ? void 0 : _me$getScrollHeight2.call(me)) ?? null;
|
|
1961
3895
|
this.cachedLineHeightDiff = ((_me$getOption = me.getOption) === null || _me$getOption === void 0 ? void 0 : _me$getOption.call(me, monaco_shim_exports.editor.EditorOption.lineHeight)) ?? null;
|
|
1962
3896
|
this.cachedComputedHeightDiff = this.computedHeight();
|
|
1963
3897
|
const oEditor = this.diffEditorView.getOriginalEditor();
|
|
1964
3898
|
const mEditor = this.diffEditorView.getModifiedEditor();
|
|
3899
|
+
this.disposeDiffPresentationTracking();
|
|
3900
|
+
this.diffComputedVersions = null;
|
|
3901
|
+
this.diffPresentationDisposables.push(this.diffEditorView.onDidUpdateDiff(() => {
|
|
3902
|
+
this.diffComputedVersions = this.captureCurrentDiffVersions();
|
|
3903
|
+
this.scheduleSyncDiffPresentationDecorations();
|
|
3904
|
+
}));
|
|
3905
|
+
this.diffPresentationDisposables.push(oEditor.onDidChangeModelContent(() => {
|
|
3906
|
+
this.scheduleSyncDiffPresentationDecorations();
|
|
3907
|
+
}));
|
|
3908
|
+
this.diffPresentationDisposables.push(mEditor.onDidChangeModelContent(() => {
|
|
3909
|
+
this.scheduleSyncDiffPresentationDecorations();
|
|
3910
|
+
}));
|
|
1965
3911
|
(_oEditor$onDidContent = oEditor.onDidContentSizeChange) === null || _oEditor$onDidContent === void 0 || _oEditor$onDidContent.call(oEditor, () => {
|
|
1966
3912
|
this._hasScrollBar = false;
|
|
1967
3913
|
this.rafScheduler.schedule("content-size-change-diff", () => {
|
|
1968
|
-
var _oEditor$getScrollHei, _oEditor$getOption, _this$
|
|
3914
|
+
var _oEditor$getScrollHei, _oEditor$getOption, _this$diffHeightManag3, _this$diffHeightManag4;
|
|
1969
3915
|
this.cachedScrollHeightDiff = ((_oEditor$getScrollHei = oEditor.getScrollHeight) === null || _oEditor$getScrollHei === void 0 ? void 0 : _oEditor$getScrollHei.call(oEditor)) ?? this.cachedScrollHeightDiff;
|
|
1970
3916
|
this.cachedLineHeightDiff = ((_oEditor$getOption = oEditor.getOption) === null || _oEditor$getOption === void 0 ? void 0 : _oEditor$getOption.call(oEditor, monaco_shim_exports.editor.EditorOption.lineHeight)) ?? this.cachedLineHeightDiff;
|
|
1971
3917
|
this.cachedComputedHeightDiff = this.computedHeight();
|
|
1972
|
-
if ((_this$
|
|
1973
|
-
(_this$
|
|
3918
|
+
if ((_this$diffHeightManag3 = this.diffHeightManager) === null || _this$diffHeightManag3 === void 0 ? void 0 : _this$diffHeightManag3.isSuppressed()) return;
|
|
3919
|
+
(_this$diffHeightManag4 = this.diffHeightManager) === null || _this$diffHeightManag4 === void 0 || _this$diffHeightManag4.update();
|
|
1974
3920
|
const computed$2 = this.computedHeight();
|
|
1975
3921
|
if (this.lastContainer) {
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
this.
|
|
1980
|
-
if (newOverflow === "auto" && this.shouldAutoScrollDiff) {
|
|
1981
|
-
var _this$modifiedModel;
|
|
1982
|
-
this.maybeScrollDiffToBottom((_this$modifiedModel = this.modifiedModel) === null || _this$modifiedModel === void 0 ? void 0 : _this$modifiedModel.getLineCount());
|
|
1983
|
-
}
|
|
3922
|
+
this.lastContainer.style.overflow = "hidden";
|
|
3923
|
+
if (computed$2 >= this.maxHeightValue - 1 && this.shouldAutoScrollDiff && !this.diffHideUnchangedRegionsDeferred) {
|
|
3924
|
+
var _this$modifiedModel3;
|
|
3925
|
+
this.maybeScrollDiffToBottom((_this$modifiedModel3 = this.modifiedModel) === null || _this$modifiedModel3 === void 0 ? void 0 : _this$modifiedModel3.getLineCount());
|
|
1984
3926
|
}
|
|
1985
3927
|
}
|
|
1986
3928
|
});
|
|
@@ -1988,22 +3930,18 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
1988
3930
|
(_mEditor$onDidContent = mEditor.onDidContentSizeChange) === null || _mEditor$onDidContent === void 0 || _mEditor$onDidContent.call(mEditor, () => {
|
|
1989
3931
|
this._hasScrollBar = false;
|
|
1990
3932
|
this.rafScheduler.schedule("content-size-change-diff", () => {
|
|
1991
|
-
var _mEditor$getScrollHei, _mEditor$getOption, _this$
|
|
3933
|
+
var _mEditor$getScrollHei, _mEditor$getOption, _this$diffHeightManag5, _this$diffHeightManag6;
|
|
1992
3934
|
this.cachedScrollHeightDiff = ((_mEditor$getScrollHei = mEditor.getScrollHeight) === null || _mEditor$getScrollHei === void 0 ? void 0 : _mEditor$getScrollHei.call(mEditor)) ?? this.cachedScrollHeightDiff;
|
|
1993
3935
|
this.cachedLineHeightDiff = ((_mEditor$getOption = mEditor.getOption) === null || _mEditor$getOption === void 0 ? void 0 : _mEditor$getOption.call(mEditor, monaco_shim_exports.editor.EditorOption.lineHeight)) ?? this.cachedLineHeightDiff;
|
|
1994
3936
|
this.cachedComputedHeightDiff = this.computedHeight();
|
|
1995
|
-
if ((_this$
|
|
1996
|
-
(_this$
|
|
3937
|
+
if ((_this$diffHeightManag5 = this.diffHeightManager) === null || _this$diffHeightManag5 === void 0 ? void 0 : _this$diffHeightManag5.isSuppressed()) return;
|
|
3938
|
+
(_this$diffHeightManag6 = this.diffHeightManager) === null || _this$diffHeightManag6 === void 0 || _this$diffHeightManag6.update();
|
|
1997
3939
|
const computed$2 = this.computedHeight();
|
|
1998
3940
|
if (this.lastContainer) {
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
this.
|
|
2003
|
-
if (newOverflow === "auto" && this.shouldAutoScrollDiff) {
|
|
2004
|
-
var _this$modifiedModel2;
|
|
2005
|
-
this.maybeScrollDiffToBottom((_this$modifiedModel2 = this.modifiedModel) === null || _this$modifiedModel2 === void 0 ? void 0 : _this$modifiedModel2.getLineCount());
|
|
2006
|
-
}
|
|
3941
|
+
this.lastContainer.style.overflow = "hidden";
|
|
3942
|
+
if (computed$2 >= this.maxHeightValue - 1 && this.shouldAutoScrollDiff && !this.diffHideUnchangedRegionsDeferred) {
|
|
3943
|
+
var _this$modifiedModel4;
|
|
3944
|
+
this.maybeScrollDiffToBottom((_this$modifiedModel4 = this.modifiedModel) === null || _this$modifiedModel4 === void 0 ? void 0 : _this$modifiedModel4.getLineCount());
|
|
2007
3945
|
}
|
|
2008
3946
|
}
|
|
2009
3947
|
});
|
|
@@ -2015,6 +3953,8 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
2015
3953
|
this.maybeScrollDiffToBottom(this.modifiedModel.getLineCount(), this.lastKnownModifiedLineCount ?? void 0);
|
|
2016
3954
|
this.setupDiffUnchangedRegionEnhancements();
|
|
2017
3955
|
this.setupDiffHunkInteractions();
|
|
3956
|
+
this.applyDiffRootAppearanceClass();
|
|
3957
|
+
this.scheduleSyncDiffPresentationDecorations();
|
|
2018
3958
|
return this.diffEditorView;
|
|
2019
3959
|
}
|
|
2020
3960
|
updateDiff(originalCode, modifiedCode, codeLanguage) {
|
|
@@ -2033,6 +3973,7 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
2033
3973
|
if (this.lastKnownModifiedCode == null) this.lastKnownModifiedCode = this.modifiedModel.getValue();
|
|
2034
3974
|
const prevO = this.lastKnownOriginalCode;
|
|
2035
3975
|
const prevM = this.lastKnownModifiedCode;
|
|
3976
|
+
if (originalCode !== prevO || modifiedCode !== prevM) this.markDiffStreamingActivity();
|
|
2036
3977
|
let didImmediate = false;
|
|
2037
3978
|
if (originalCode !== prevO && originalCode.startsWith(prevO)) {
|
|
2038
3979
|
this.appendOriginal(originalCode.slice(prevO.length));
|
|
@@ -2060,6 +4001,7 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
2060
4001
|
}
|
|
2061
4002
|
const prev = this.lastKnownOriginalCode ?? this.originalModel.getValue();
|
|
2062
4003
|
if (prev === newCode) return;
|
|
4004
|
+
this.markDiffStreamingActivity();
|
|
2063
4005
|
if (newCode.startsWith(prev) && prev.length < newCode.length) this.appendOriginal(newCode.slice(prev.length), codeLanguage);
|
|
2064
4006
|
else {
|
|
2065
4007
|
this.flushOriginalAppendBufferSync();
|
|
@@ -2075,6 +4017,7 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
2075
4017
|
}
|
|
2076
4018
|
const prev = this.lastKnownModifiedCode ?? this.modifiedModel.getValue();
|
|
2077
4019
|
if (prev === newCode) return;
|
|
4020
|
+
this.markDiffStreamingActivity();
|
|
2078
4021
|
if (newCode.startsWith(prev) && prev.length < newCode.length) this.appendModified(newCode.slice(prev.length), codeLanguage);
|
|
2079
4022
|
else {
|
|
2080
4023
|
this.flushModifiedAppendBufferSync();
|
|
@@ -2088,28 +4031,17 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
2088
4031
|
const computed$2 = this.computedHeight();
|
|
2089
4032
|
if (computed$2 >= this.maxHeightValue - 1 && this.lastContainer) {
|
|
2090
4033
|
this.lastContainer.style.height = `${this.maxHeightValue}px`;
|
|
2091
|
-
this.lastContainer.style.overflow = "
|
|
4034
|
+
this.lastContainer.style.overflow = "hidden";
|
|
2092
4035
|
}
|
|
2093
4036
|
if (shouldImmediate) this.scheduleImmediateRevealAfterLayoutDiff(newLine);
|
|
2094
4037
|
else this.maybeScrollDiffToBottom(newLine, prevLine);
|
|
2095
|
-
if (this.autoScrollOnUpdate && this.shouldAutoScrollDiff) try {
|
|
2096
|
-
var _editor3, _me2$getModel, _me2$getScrollTop;
|
|
2097
|
-
const ScrollType = monaco_shim_exports.ScrollType || ((_editor3 = monaco_shim_exports.editor) === null || _editor3 === void 0 ? void 0 : _editor3.ScrollType);
|
|
2098
|
-
const immediate = ScrollType && typeof ScrollType.Immediate !== "undefined" ? ScrollType.Immediate : void 0;
|
|
2099
|
-
const me2 = this.diffEditorView.getModifiedEditor();
|
|
2100
|
-
const targetLine = ((_me2$getModel = me2.getModel()) === null || _me2$getModel === void 0 ? void 0 : _me2$getModel.getLineCount()) ?? newLine;
|
|
2101
|
-
if (typeof immediate !== "undefined") me2.revealLine(targetLine, immediate);
|
|
2102
|
-
else me2.revealLine(targetLine);
|
|
2103
|
-
this.lastRevealLineDiff = targetLine;
|
|
2104
|
-
this.shouldAutoScrollDiff = true;
|
|
2105
|
-
this.lastScrollTopDiff = ((_me2$getScrollTop = me2.getScrollTop) === null || _me2$getScrollTop === void 0 ? void 0 : _me2$getScrollTop.call(me2)) ?? this.lastScrollTopDiff;
|
|
2106
|
-
} catch {}
|
|
2107
4038
|
}
|
|
2108
4039
|
}
|
|
2109
4040
|
this.lastKnownModifiedCode = newCode;
|
|
2110
4041
|
}
|
|
2111
4042
|
appendOriginal(appendText, codeLanguage) {
|
|
2112
4043
|
if (!this.diffEditorView || !this.originalModel || !appendText) return;
|
|
4044
|
+
this.markDiffStreamingActivity();
|
|
2113
4045
|
if (codeLanguage) {
|
|
2114
4046
|
const lang = processedLanguage(codeLanguage);
|
|
2115
4047
|
if (lang && this.originalModel.getLanguageId() !== lang) monaco_shim_exports.editor.setModelLanguage(this.originalModel, lang);
|
|
@@ -2119,6 +4051,7 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
2119
4051
|
}
|
|
2120
4052
|
appendModified(appendText, codeLanguage) {
|
|
2121
4053
|
if (!this.diffEditorView || !this.modifiedModel || !appendText) return;
|
|
4054
|
+
this.markDiffStreamingActivity();
|
|
2122
4055
|
if (codeLanguage) {
|
|
2123
4056
|
const lang = processedLanguage(codeLanguage);
|
|
2124
4057
|
if (lang && this.modifiedModel.getLanguageId() !== lang) monaco_shim_exports.editor.setModelLanguage(this.modifiedModel, lang);
|
|
@@ -2134,6 +4067,102 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
2134
4067
|
if (this.originalModel && this.originalModel.getLanguageId() !== language) monaco_shim_exports.editor.setModelLanguage(this.originalModel, language);
|
|
2135
4068
|
if (this.modifiedModel && this.modifiedModel.getLanguageId() !== language) monaco_shim_exports.editor.setModelLanguage(this.modifiedModel, language);
|
|
2136
4069
|
}
|
|
4070
|
+
async setDiffModels(models, options = {}) {
|
|
4071
|
+
var _this$originalModel2, _this$modifiedModel5, _this$diffEditorView$5, _this$diffEditorView$6, _this$diffEditorView$7, _this$diffEditorView$8;
|
|
4072
|
+
if (!this.diffEditorView) return;
|
|
4073
|
+
const transitionRequestId = ++this.diffModelTransitionRequestId;
|
|
4074
|
+
this.disposePendingPreparedDiffViewModel();
|
|
4075
|
+
const nextOriginal = models.original;
|
|
4076
|
+
const nextModified = models.modified;
|
|
4077
|
+
this.applyDiffModelLanguage(models, options.codeLanguage);
|
|
4078
|
+
const currentOriginalValue = this.lastKnownOriginalCode ?? ((_this$originalModel2 = this.originalModel) === null || _this$originalModel2 === void 0 ? void 0 : _this$originalModel2.getValue()) ?? null;
|
|
4079
|
+
const currentModifiedValue = this.lastKnownModifiedCode ?? ((_this$modifiedModel5 = this.modifiedModel) === null || _this$modifiedModel5 === void 0 ? void 0 : _this$modifiedModel5.getValue()) ?? null;
|
|
4080
|
+
const nextOriginalValue = nextOriginal.getValue();
|
|
4081
|
+
const nextModifiedValue = nextModified.getValue();
|
|
4082
|
+
const sameContent = currentOriginalValue === nextOriginalValue && currentModifiedValue === nextModifiedValue;
|
|
4083
|
+
const preserveViewState = options.preserveViewState ?? sameContent;
|
|
4084
|
+
let preparedViewModel = null;
|
|
4085
|
+
if (preserveViewState && sameContent) try {
|
|
4086
|
+
preparedViewModel = this.diffEditorView.createViewModel({
|
|
4087
|
+
original: nextOriginal,
|
|
4088
|
+
modified: nextModified
|
|
4089
|
+
});
|
|
4090
|
+
this.pendingPreparedDiffViewModel = preparedViewModel;
|
|
4091
|
+
await preparedViewModel.waitForDiff();
|
|
4092
|
+
} catch {
|
|
4093
|
+
if (preparedViewModel === this.pendingPreparedDiffViewModel) this.pendingPreparedDiffViewModel = null;
|
|
4094
|
+
try {
|
|
4095
|
+
preparedViewModel === null || preparedViewModel === void 0 || preparedViewModel.dispose();
|
|
4096
|
+
} catch {}
|
|
4097
|
+
preparedViewModel = null;
|
|
4098
|
+
}
|
|
4099
|
+
if (preparedViewModel === this.pendingPreparedDiffViewModel) this.pendingPreparedDiffViewModel = null;
|
|
4100
|
+
if (!this.diffEditorView || this.diffModelTransitionRequestId !== transitionRequestId) {
|
|
4101
|
+
if (preparedViewModel) try {
|
|
4102
|
+
preparedViewModel.dispose();
|
|
4103
|
+
} catch {}
|
|
4104
|
+
return;
|
|
4105
|
+
}
|
|
4106
|
+
const nextModelTarget = preparedViewModel ?? {
|
|
4107
|
+
original: nextOriginal,
|
|
4108
|
+
modified: nextModified
|
|
4109
|
+
};
|
|
4110
|
+
if (!this.originalModel || !this.modifiedModel) {
|
|
4111
|
+
this.diffEditorView.setModel(nextModelTarget);
|
|
4112
|
+
this.originalModel = nextOriginal;
|
|
4113
|
+
this.modifiedModel = nextModified;
|
|
4114
|
+
this.originalModelOwned = false;
|
|
4115
|
+
this.modifiedModelOwned = false;
|
|
4116
|
+
this.syncDiffKnownValues();
|
|
4117
|
+
this.refreshDiffPresentation();
|
|
4118
|
+
return;
|
|
4119
|
+
}
|
|
4120
|
+
this.rafScheduler.cancel("diff");
|
|
4121
|
+
this.pendingDiffUpdate = null;
|
|
4122
|
+
this.flushOriginalAppendBufferSync();
|
|
4123
|
+
this.flushModifiedAppendBufferSync();
|
|
4124
|
+
const currentOriginal = this.originalModel;
|
|
4125
|
+
const currentModified = this.modifiedModel;
|
|
4126
|
+
const shouldRestorePersistedUnchangedState = preserveViewState && !sameContent;
|
|
4127
|
+
const preservedScrollPosition = preserveViewState ? this.captureDiffScrollPosition() : null;
|
|
4128
|
+
const preservedViewportAnchor = preserveViewState && sameContent ? this.captureModifiedViewportAnchor() : null;
|
|
4129
|
+
const viewState = preserveViewState ? this.diffEditorView.saveViewState() : null;
|
|
4130
|
+
this.queuePendingDiffScrollRestore(preservedScrollPosition, shouldRestorePersistedUnchangedState ? 2 : 0);
|
|
4131
|
+
if (shouldRestorePersistedUnchangedState) this.capturePersistedDiffUnchangedState();
|
|
4132
|
+
const applyModelSwap = () => {
|
|
4133
|
+
var _this$diffEditorView35;
|
|
4134
|
+
(_this$diffEditorView35 = this.diffEditorView) === null || _this$diffEditorView35 === void 0 || _this$diffEditorView35.setModel(nextModelTarget);
|
|
4135
|
+
};
|
|
4136
|
+
if (preserveViewState) this.withLockedDiffScrollPosition(applyModelSwap);
|
|
4137
|
+
else applyModelSwap();
|
|
4138
|
+
const previousOriginalOwned = this.originalModelOwned;
|
|
4139
|
+
const previousModifiedOwned = this.modifiedModelOwned;
|
|
4140
|
+
this.originalModel = nextOriginal;
|
|
4141
|
+
this.modifiedModel = nextModified;
|
|
4142
|
+
this.originalModelOwned = false;
|
|
4143
|
+
this.modifiedModelOwned = false;
|
|
4144
|
+
this.lastKnownOriginalCode = nextOriginalValue;
|
|
4145
|
+
this.lastKnownModifiedCode = nextModifiedValue;
|
|
4146
|
+
this.lastKnownModifiedLineCount = nextModified.getLineCount();
|
|
4147
|
+
this.lastKnownModifiedDirty = false;
|
|
4148
|
+
this._hasScrollBar = false;
|
|
4149
|
+
this.cachedScrollHeightDiff = ((_this$diffEditorView$5 = (_this$diffEditorView$6 = this.diffEditorView.getModifiedEditor()).getScrollHeight) === null || _this$diffEditorView$5 === void 0 ? void 0 : _this$diffEditorView$5.call(_this$diffEditorView$6)) ?? null;
|
|
4150
|
+
this.cachedLineHeightDiff = ((_this$diffEditorView$7 = (_this$diffEditorView$8 = this.diffEditorView.getModifiedEditor()).getOption) === null || _this$diffEditorView$7 === void 0 ? void 0 : _this$diffEditorView$7.call(_this$diffEditorView$8, monaco_shim_exports.editor.EditorOption.lineHeight)) ?? null;
|
|
4151
|
+
this.cachedComputedHeightDiff = this.computedHeight();
|
|
4152
|
+
this.diffHunkLineChanges = this.getEffectiveLineChanges();
|
|
4153
|
+
this.hideDiffHunkActions();
|
|
4154
|
+
this.clearDiffUnchangedBridgeOverlay(false);
|
|
4155
|
+
this.syncDiffUnchangedViewZoneHeights();
|
|
4156
|
+
this.diffComputedVersions = null;
|
|
4157
|
+
if (viewState) this.restoreDiffViewState(viewState);
|
|
4158
|
+
this.refreshDiffPresentation();
|
|
4159
|
+
this.scheduleSyncDiffPresentationDecorations();
|
|
4160
|
+
if (shouldRestorePersistedUnchangedState) this.scheduleRestorePersistedDiffUnchangedState();
|
|
4161
|
+
this.applyPendingDiffScrollRestore();
|
|
4162
|
+
if (preservedViewportAnchor) this.scheduleRestoreModifiedViewportAnchor(preservedViewportAnchor);
|
|
4163
|
+
this.disposePreviousDiffModel(currentOriginal, previousOriginalOwned, nextOriginal);
|
|
4164
|
+
this.disposePreviousDiffModel(currentModified, previousModifiedOwned, nextModified);
|
|
4165
|
+
}
|
|
2137
4166
|
getDiffEditorView() {
|
|
2138
4167
|
return this.diffEditorView;
|
|
2139
4168
|
}
|
|
@@ -2144,6 +4173,8 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
2144
4173
|
};
|
|
2145
4174
|
}
|
|
2146
4175
|
cleanup() {
|
|
4176
|
+
this.diffModelTransitionRequestId += 1;
|
|
4177
|
+
this.disposePendingPreparedDiffViewModel();
|
|
2147
4178
|
this.rafScheduler.cancel("diff");
|
|
2148
4179
|
this.pendingDiffUpdate = null;
|
|
2149
4180
|
this.rafScheduler.cancel("appendDiff");
|
|
@@ -2158,6 +4189,7 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
2158
4189
|
this.rafScheduler.cancel("sync-last-known-modified");
|
|
2159
4190
|
this.disposeDiffHunkInteractions();
|
|
2160
4191
|
this.disposeDiffUnchangedRegionEnhancements();
|
|
4192
|
+
this.disposeDiffPresentationTracking();
|
|
2161
4193
|
if (this.diffScrollWatcher) {
|
|
2162
4194
|
this.diffScrollWatcher.dispose();
|
|
2163
4195
|
this.diffScrollWatcher = null;
|
|
@@ -2170,18 +4202,18 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
2170
4202
|
this.diffEditorView.dispose();
|
|
2171
4203
|
this.diffEditorView = null;
|
|
2172
4204
|
}
|
|
2173
|
-
if (this.originalModel)
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
this.modifiedModel = null;
|
|
2180
|
-
}
|
|
4205
|
+
if (this.originalModel && this.originalModelOwned) this.originalModel.dispose();
|
|
4206
|
+
if (this.modifiedModel && this.modifiedModelOwned) this.modifiedModel.dispose();
|
|
4207
|
+
this.originalModel = null;
|
|
4208
|
+
this.modifiedModel = null;
|
|
4209
|
+
this.originalModelOwned = false;
|
|
4210
|
+
this.modifiedModelOwned = false;
|
|
2181
4211
|
this.lastKnownOriginalCode = null;
|
|
2182
4212
|
this.lastKnownModifiedCode = null;
|
|
4213
|
+
this.diffRootAppearanceSignature = null;
|
|
2183
4214
|
if (this.lastContainer) {
|
|
2184
4215
|
this.lastContainer.classList.remove("stream-monaco-diff-root");
|
|
4216
|
+
this.lastContainer.classList.remove(...DiffEditorManager.diffLineStyleClasses, ...DiffEditorManager.diffUnchangedRegionStyleClasses, ...DiffEditorManager.diffLayoutModeClasses, ...DiffEditorManager.diffAppearanceClasses);
|
|
2185
4217
|
this.lastContainer.innerHTML = "";
|
|
2186
4218
|
this.lastContainer = null;
|
|
2187
4219
|
}
|
|
@@ -2200,8 +4232,15 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
2200
4232
|
this.revealTicketDiff = 0;
|
|
2201
4233
|
this.lastRevealLineDiff = null;
|
|
2202
4234
|
this.diffPersistedUnchangedModelState = null;
|
|
4235
|
+
this.pendingDiffScrollRestorePosition = null;
|
|
4236
|
+
this.pendingDiffScrollRestoreBudget = 0;
|
|
4237
|
+
this.diffHideUnchangedRegionsResolved = null;
|
|
4238
|
+
this.diffHideUnchangedRegionsDeferred = false;
|
|
4239
|
+
this.clearPendingDiffThemeSync();
|
|
2203
4240
|
}
|
|
2204
4241
|
safeClean() {
|
|
4242
|
+
this.diffModelTransitionRequestId += 1;
|
|
4243
|
+
this.disposePendingPreparedDiffViewModel();
|
|
2205
4244
|
this.rafScheduler.cancel("diff");
|
|
2206
4245
|
this.pendingDiffUpdate = null;
|
|
2207
4246
|
this.rafScheduler.cancel("appendDiff");
|
|
@@ -2215,6 +4254,7 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
2215
4254
|
this.hideDiffHunkActions();
|
|
2216
4255
|
this.cancelScheduledHideDiffHunkActions();
|
|
2217
4256
|
this.disposeDiffUnchangedRegionEnhancements();
|
|
4257
|
+
this.disposeDiffPresentationTracking();
|
|
2218
4258
|
if (this.diffScrollWatcher) {
|
|
2219
4259
|
this.diffScrollWatcher.dispose();
|
|
2220
4260
|
this.diffScrollWatcher = null;
|
|
@@ -2241,6 +4281,8 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
2241
4281
|
this.revealTicketDiff = 0;
|
|
2242
4282
|
this.lastRevealLineDiff = null;
|
|
2243
4283
|
this.diffPersistedUnchangedModelState = null;
|
|
4284
|
+
this.diffHideUnchangedRegionsDeferred = false;
|
|
4285
|
+
this.clearPendingDiffThemeSync();
|
|
2244
4286
|
this.rafScheduler.cancel("content-size-change-diff");
|
|
2245
4287
|
this.rafScheduler.cancel("sync-last-known-modified");
|
|
2246
4288
|
}
|
|
@@ -2299,7 +4341,7 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
2299
4341
|
const computed$2 = this.computedHeight();
|
|
2300
4342
|
if (computed$2 >= this.maxHeightValue - 1 && this.lastContainer) {
|
|
2301
4343
|
this.lastContainer.style.height = `${this.maxHeightValue}px`;
|
|
2302
|
-
this.lastContainer.style.overflow = "
|
|
4344
|
+
this.lastContainer.style.overflow = "hidden";
|
|
2303
4345
|
}
|
|
2304
4346
|
if (shouldImmediate) this.scheduleImmediateRevealAfterLayoutDiff(newMLineCount);
|
|
2305
4347
|
else this.maybeScrollDiffToBottom(newMLineCount, prevMLineCount);
|
|
@@ -2393,7 +4435,7 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
2393
4435
|
const computed$3 = this.computedHeight();
|
|
2394
4436
|
if (computed$3 >= this.maxHeightValue - 1 && this.lastContainer) {
|
|
2395
4437
|
this.lastContainer.style.height = `${this.maxHeightValue}px`;
|
|
2396
|
-
this.lastContainer.style.overflow = "
|
|
4438
|
+
this.lastContainer.style.overflow = "hidden";
|
|
2397
4439
|
}
|
|
2398
4440
|
if (shouldImmediate$1) this.scheduleImmediateRevealAfterLayoutDiff(newLine$1);
|
|
2399
4441
|
else this.maybeScrollDiffToBottom(newLine$1, prevLine);
|
|
@@ -2425,23 +4467,11 @@ var DiffEditorManager = class DiffEditorManager {
|
|
|
2425
4467
|
if (computed$2 >= this.maxHeightValue - 1 && this.lastContainer) this.lastContainer.style.height = `${this.maxHeightValue}px`;
|
|
2426
4468
|
if (shouldImmediate) this.scheduleImmediateRevealAfterLayoutDiff(newLine);
|
|
2427
4469
|
else this.maybeScrollDiffToBottom(newLine, prevLine);
|
|
2428
|
-
if (this.autoScrollOnUpdate && this.shouldAutoScrollDiff) try {
|
|
2429
|
-
var _editor4, _me2$getModel2, _me2$getScrollTop2;
|
|
2430
|
-
const ScrollType = monaco_shim_exports.ScrollType || ((_editor4 = monaco_shim_exports.editor) === null || _editor4 === void 0 ? void 0 : _editor4.ScrollType);
|
|
2431
|
-
const immediate = ScrollType && typeof ScrollType.Immediate !== "undefined" ? ScrollType.Immediate : void 0;
|
|
2432
|
-
const me2 = this.diffEditorView.getModifiedEditor();
|
|
2433
|
-
const targetLine = ((_me2$getModel2 = me2.getModel()) === null || _me2$getModel2 === void 0 ? void 0 : _me2$getModel2.getLineCount()) ?? newLine;
|
|
2434
|
-
if (typeof immediate !== "undefined") me2.revealLine(targetLine, immediate);
|
|
2435
|
-
else me2.revealLine(targetLine);
|
|
2436
|
-
this.lastRevealLineDiff = targetLine;
|
|
2437
|
-
this.shouldAutoScrollDiff = true;
|
|
2438
|
-
this.lastScrollTopDiff = ((_me2$getScrollTop2 = me2.getScrollTop) === null || _me2$getScrollTop2 === void 0 ? void 0 : _me2$getScrollTop2.call(me2)) ?? this.lastScrollTopDiff;
|
|
2439
|
-
} catch {}
|
|
2440
4470
|
if (suppressedByFlush) watcherApi.setSuppressed(false);
|
|
2441
4471
|
try {
|
|
2442
|
-
var _this$
|
|
4472
|
+
var _this$diffEditorView36, _this$diffEditorView37, _this$diffEditorView38;
|
|
2443
4473
|
this.shouldAutoScrollDiff = true;
|
|
2444
|
-
this.lastScrollTopDiff = ((_this$
|
|
4474
|
+
this.lastScrollTopDiff = ((_this$diffEditorView36 = this.diffEditorView) === null || _this$diffEditorView36 === void 0 || (_this$diffEditorView38 = (_this$diffEditorView37 = _this$diffEditorView36.getModifiedEditor()).getScrollTop) === null || _this$diffEditorView38 === void 0 ? void 0 : _this$diffEditorView38.call(_this$diffEditorView37)) ?? this.lastScrollTopDiff;
|
|
2445
4475
|
} catch {}
|
|
2446
4476
|
}
|
|
2447
4477
|
applyMinimalEditToModel(model, prev, next) {
|
|
@@ -3412,7 +5442,9 @@ let globalAppliedThemeName = null;
|
|
|
3412
5442
|
* updateModified: (newCode: string, codeLanguage?: string) => void,
|
|
3413
5443
|
* appendOriginal: (appendText: string, codeLanguage?: string) => void,
|
|
3414
5444
|
* appendModified: (appendText: string, codeLanguage?: string) => void,
|
|
5445
|
+
* setDiffModels: (models: DiffModelPair, options?: DiffModelTransitionOptions) => Promise<void>,
|
|
3415
5446
|
* setTheme: (theme: MonacoTheme) => Promise<void>,
|
|
5447
|
+
* refreshDiffPresentation: () => void,
|
|
3416
5448
|
* setLanguage: (language: MonacoLanguage) => void,
|
|
3417
5449
|
* getCurrentTheme: () => string,
|
|
3418
5450
|
* getEditor: () => typeof monaco.editor,
|
|
@@ -3432,7 +5464,9 @@ let globalAppliedThemeName = null;
|
|
|
3432
5464
|
* @property {Function} updateModified - 仅更新 Diff 的 modified 内容(增量更新)
|
|
3433
5465
|
* @property {Function} appendOriginal - 在 Diff 的 original 末尾追加(显式流式场景)
|
|
3434
5466
|
* @property {Function} appendModified - 在 Diff 的 modified 末尾追加(显式流式场景)
|
|
5467
|
+
* @property {Function} setDiffModels - 切换为一对新的 Diff models;当内容未变化时自动走保留视图状态的无抖动路径
|
|
3435
5468
|
* @property {Function} setTheme - 切换编辑器主题,返回 Promise,在主题应用完成时 resolve
|
|
5469
|
+
* @property {Function} refreshDiffPresentation - 在不 remount 的情况下,重算 diff chrome / unchanged overlay 的表现层
|
|
3436
5470
|
* @property {Function} setLanguage - 切换编辑器语言
|
|
3437
5471
|
* @property {Function} getCurrentTheme - 获取当前主题名称
|
|
3438
5472
|
* @property {Function} getEditor - 获取 Monaco 的静态 editor 对象(用于静态方法调用)
|
|
@@ -3550,12 +5584,14 @@ function useMonaco(monacoOptions = {}) {
|
|
|
3550
5584
|
try {
|
|
3551
5585
|
monaco_shim_exports.editor.setTheme(themeName);
|
|
3552
5586
|
globalAppliedThemeName = themeName;
|
|
5587
|
+
monacoOptions.theme = themeName;
|
|
3553
5588
|
} catch {
|
|
3554
5589
|
try {
|
|
3555
5590
|
const maybeHighlighter = await registerMonacoThemes(themes, languages$1);
|
|
3556
5591
|
if (token !== globalThemeRequestSeq) return;
|
|
3557
5592
|
monaco_shim_exports.editor.setTheme(themeName);
|
|
3558
5593
|
globalAppliedThemeName = themeName;
|
|
5594
|
+
monacoOptions.theme = themeName;
|
|
3559
5595
|
await tryLoadAndSetShikiTheme(maybeHighlighter, themeName).catch(() => void 0);
|
|
3560
5596
|
} catch (err2) {
|
|
3561
5597
|
console.warn(`Failed to set theme "${themeName}":`, err2);
|
|
@@ -3563,6 +5599,11 @@ function useMonaco(monacoOptions = {}) {
|
|
|
3563
5599
|
}
|
|
3564
5600
|
}
|
|
3565
5601
|
if (token !== globalThemeRequestSeq) return;
|
|
5602
|
+
try {
|
|
5603
|
+
diffMgr === null || diffMgr === void 0 || diffMgr.notifyThemeChange(themeName);
|
|
5604
|
+
} catch (err) {
|
|
5605
|
+
console.warn("diff theme sync threw an error:", err);
|
|
5606
|
+
}
|
|
3566
5607
|
try {
|
|
3567
5608
|
if (typeof monacoOptions.onThemeChange === "function") await monacoOptions.onThemeChange(themeName);
|
|
3568
5609
|
} catch (err) {
|
|
@@ -3614,7 +5655,7 @@ function useMonaco(monacoOptions = {}) {
|
|
|
3614
5655
|
const ds = monacoOptions.onBeforeCreate(monaco_shim_exports);
|
|
3615
5656
|
if (ds) disposals.push(...ds);
|
|
3616
5657
|
}
|
|
3617
|
-
const initialThemeName =
|
|
5658
|
+
const initialThemeName = monacoOptions.theme ?? requestedThemeName ?? globalRequestedThemeName ?? currentTheme.value;
|
|
3618
5659
|
await ensureThemeRegistered(initialThemeName);
|
|
3619
5660
|
editorMgr = new EditorManager(monacoOptions, maxHeightValue, maxHeightCSS, autoScrollOnUpdate, autoScrollInitial, autoScrollThresholdPx, autoScrollThresholdLines, monacoOptions.revealDebounceMs);
|
|
3620
5661
|
editorView = await editorMgr.createEditor(container, code, language, initialThemeName);
|
|
@@ -3645,7 +5686,7 @@ function useMonaco(monacoOptions = {}) {
|
|
|
3645
5686
|
const ds = monacoOptions.onBeforeCreate(monaco_shim_exports);
|
|
3646
5687
|
if (ds) disposals.push(...ds);
|
|
3647
5688
|
}
|
|
3648
|
-
const initialThemeName =
|
|
5689
|
+
const initialThemeName = monacoOptions.theme ?? requestedThemeName ?? globalRequestedThemeName ?? currentTheme.value;
|
|
3649
5690
|
await ensureThemeRegistered(initialThemeName);
|
|
3650
5691
|
try {
|
|
3651
5692
|
monaco_shim_exports.editor.setTheme(initialThemeName);
|
|
@@ -3896,6 +5937,16 @@ function useMonaco(monacoOptions = {}) {
|
|
|
3896
5937
|
function appendModified(appendText, codeLanguage) {
|
|
3897
5938
|
if (diffMgr) diffMgr.appendModified(appendText, codeLanguage);
|
|
3898
5939
|
}
|
|
5940
|
+
async function setDiffModels(models, options) {
|
|
5941
|
+
if (!diffMgr) return;
|
|
5942
|
+
await diffMgr.setDiffModels(models, options);
|
|
5943
|
+
const activeModels = diffMgr.getDiffModels();
|
|
5944
|
+
originalModel = activeModels.original;
|
|
5945
|
+
modifiedModel = activeModels.modified;
|
|
5946
|
+
}
|
|
5947
|
+
function refreshDiffPresentation() {
|
|
5948
|
+
if (diffMgr) diffMgr.refreshDiffPresentation();
|
|
5949
|
+
}
|
|
3899
5950
|
return {
|
|
3900
5951
|
createEditor,
|
|
3901
5952
|
createDiffEditor,
|
|
@@ -3919,7 +5970,9 @@ function useMonaco(monacoOptions = {}) {
|
|
|
3919
5970
|
updateModified,
|
|
3920
5971
|
appendOriginal,
|
|
3921
5972
|
appendModified,
|
|
5973
|
+
setDiffModels,
|
|
3922
5974
|
setTheme: setThemeInternal,
|
|
5975
|
+
refreshDiffPresentation,
|
|
3923
5976
|
setLanguage(language) {
|
|
3924
5977
|
if (editorMgr) {
|
|
3925
5978
|
editorMgr.setLanguage(language, languages$1);
|
|
@@ -3951,6 +6004,7 @@ function useMonaco(monacoOptions = {}) {
|
|
|
3951
6004
|
return diffEditorView;
|
|
3952
6005
|
},
|
|
3953
6006
|
getDiffModels() {
|
|
6007
|
+
if (diffMgr) return diffMgr.getDiffModels();
|
|
3954
6008
|
return {
|
|
3955
6009
|
original: originalModel,
|
|
3956
6010
|
modified: modifiedModel
|