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