@adecore/editor-react 0.53.2 → 0.54.0

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.
Files changed (131) hide show
  1. package/dist/AnchoredPopup.d.ts +1 -1
  2. package/dist/AnchoredPopup.js +27 -12
  3. package/dist/AttributionCard.d.ts +1 -1
  4. package/dist/BaselineStatus.js +1 -1
  5. package/dist/CallHierarchyPanel.js +11 -10
  6. package/dist/ChangeReview.d.ts +1 -1
  7. package/dist/CodeAuthorsCard.js +2 -2
  8. package/dist/CompletionPopup.js +18 -14
  9. package/dist/DiffView.d.ts +2 -2
  10. package/dist/DiffView.js +159 -143
  11. package/dist/EditorContextMenu.js +1 -1
  12. package/dist/EditorView.d.ts +2 -2
  13. package/dist/EditorView.js +97 -81
  14. package/dist/FindReplace.js +3 -3
  15. package/dist/HoverCard.d.ts +3 -3
  16. package/dist/HoverCard.js +3 -3
  17. package/dist/HoverSections.js +1 -1
  18. package/dist/LanguagePopups.js +1 -1
  19. package/dist/Markdown.js +15 -3
  20. package/dist/PeekPanel.js +124 -103
  21. package/dist/PickPopup.js +8 -4
  22. package/dist/RenameCard.js +7 -7
  23. package/dist/RenderedDocs.d.ts +1 -1
  24. package/dist/RenderedDocs.js +1 -1
  25. package/dist/SplitDiffView.js +21 -4
  26. package/dist/SymbolPicker.js +93 -89
  27. package/dist/WrapCard.js +1 -1
  28. package/dist/call-hierarchy.d.ts +1 -1
  29. package/dist/call-hierarchy.js +3 -3
  30. package/dist/code-actions.js +2 -2
  31. package/dist/code-vision.d.ts +1 -1
  32. package/dist/completion-model.d.ts +1 -1
  33. package/dist/completion-model.js +2 -2
  34. package/dist/completion.d.ts +1 -1
  35. package/dist/completion.js +12 -12
  36. package/dist/diagnostics.d.ts +1 -1
  37. package/dist/diagnostics.js +1 -1
  38. package/dist/diff-overlays.js +2 -2
  39. package/dist/editor-language.d.ts +12 -12
  40. package/dist/editor-language.js +10 -10
  41. package/dist/editor-react.css +4 -4
  42. package/dist/highlights.d.ts +1 -1
  43. package/dist/highlights.js +2 -2
  44. package/dist/host-types.d.ts +4 -4
  45. package/dist/hover.js +1 -1
  46. package/dist/inlay-hints.js +1 -1
  47. package/dist/live-templates.js +1 -1
  48. package/dist/markup.js +1 -1
  49. package/dist/navigation.d.ts +1 -1
  50. package/dist/navigation.js +3 -3
  51. package/dist/peek.js +1 -1
  52. package/dist/popups.d.ts +5 -5
  53. package/dist/project-language.d.ts +4 -4
  54. package/dist/project-language.js +5 -5
  55. package/dist/rename.js +1 -1
  56. package/dist/rendered-docs.d.ts +1 -1
  57. package/dist/rendered-docs.js +1 -1
  58. package/dist/shortcut-keys.d.ts +1 -1
  59. package/dist/signature.js +1 -1
  60. package/dist/snippet-field-transforms.d.ts +2 -2
  61. package/dist/snippet-insert.js +3 -3
  62. package/dist/snippet-session.d.ts +2 -2
  63. package/dist/snippet-session.js +5 -5
  64. package/dist/snippet-transform-queue.d.ts +1 -1
  65. package/dist/surround.js +1 -1
  66. package/dist/symbol-picker.js +2 -2
  67. package/dist/templates.js +1 -1
  68. package/dist/use-problem-counts.d.ts +1 -1
  69. package/package.json +6 -6
  70. package/src/AnchoredPopup.tsx +7 -3
  71. package/src/AttributionCard.tsx +1 -1
  72. package/src/BaselineStatus.tsx +1 -1
  73. package/src/CallHierarchyPanel.tsx +13 -12
  74. package/src/ChangeReview.tsx +1 -1
  75. package/src/CodeAuthorsCard.tsx +2 -2
  76. package/src/CompletionPopup.tsx +16 -13
  77. package/src/DiffView.tsx +12 -6
  78. package/src/EditorContextMenu.tsx +2 -2
  79. package/src/EditorView.tsx +14 -6
  80. package/src/FindReplace.tsx +3 -3
  81. package/src/HoverCard.tsx +7 -7
  82. package/src/HoverSections.tsx +1 -1
  83. package/src/LanguagePopups.tsx +3 -3
  84. package/src/Markdown.tsx +13 -2
  85. package/src/PeekPanel.tsx +13 -13
  86. package/src/PickPopup.tsx +6 -5
  87. package/src/RenameCard.tsx +8 -8
  88. package/src/RenderedDocs.tsx +3 -3
  89. package/src/SplitDiffView.tsx +14 -5
  90. package/src/SymbolPicker.tsx +6 -6
  91. package/src/WrapCard.tsx +2 -2
  92. package/src/call-hierarchy.ts +5 -5
  93. package/src/code-actions.ts +3 -3
  94. package/src/code-authors.ts +1 -1
  95. package/src/code-vision.ts +3 -3
  96. package/src/completion-model.ts +3 -3
  97. package/src/completion.ts +15 -15
  98. package/src/diagnostics.ts +4 -4
  99. package/src/diff-overlays.tsx +4 -4
  100. package/src/editor-language.ts +13 -13
  101. package/src/editor-react.css +4 -4
  102. package/src/format-on-type.ts +1 -1
  103. package/src/highlights.ts +3 -3
  104. package/src/host-types.ts +4 -4
  105. package/src/hover.ts +3 -3
  106. package/src/inlay-hints.ts +1 -1
  107. package/src/line-edits.ts +1 -1
  108. package/src/live-templates.ts +2 -2
  109. package/src/markup.ts +2 -2
  110. package/src/navigation.ts +5 -5
  111. package/src/patch-decorations.ts +1 -1
  112. package/src/peek.ts +3 -3
  113. package/src/pick.ts +1 -1
  114. package/src/popups.ts +5 -5
  115. package/src/postfix.ts +1 -1
  116. package/src/project-language.ts +7 -7
  117. package/src/proposal-model.ts +1 -1
  118. package/src/rename.ts +3 -3
  119. package/src/rendered-docs.ts +2 -2
  120. package/src/shortcut-keys.ts +1 -1
  121. package/src/signature.ts +3 -3
  122. package/src/snippet-field-transforms.ts +2 -2
  123. package/src/snippet-insert.ts +3 -3
  124. package/src/snippet-session.ts +7 -7
  125. package/src/snippet-transform-queue.ts +1 -1
  126. package/src/surround.ts +1 -1
  127. package/src/symbol-picker-model.ts +1 -1
  128. package/src/symbol-picker.ts +3 -3
  129. package/src/templates.ts +1 -1
  130. package/src/use-problem-counts.ts +1 -1
  131. package/src/workspace-edit.ts +1 -1
package/dist/PeekPanel.js CHANGED
@@ -1,26 +1,26 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
+ import { fileUriToPath } from '@adecore/lsp';
3
+ import { FileIcon, IconButton, ScrollArea, Tooltip } from '@adecore/ui';
4
+ import { formatNumber } from '@adecore/ui/format';
5
+ import { ChevronDown, ChevronRight, X } from 'lucide-react';
2
6
  import { useEffect, useRef, useState } from 'react';
3
7
  import { createPortal } from 'react-dom';
4
8
  import { useTranslation } from 'react-i18next';
5
- import { ChevronDown, ChevronRight, X } from 'lucide-react';
6
- import { fileUriToPath } from '@adecore/lsp';
7
- import { FileIcon, IconButton, Tooltip } from '@adecore/ui';
8
- import { formatNumber } from '@adecore/ui/format';
9
- import { basenameOf, relativeTo } from './paths.js';
10
9
  import { shikiLanguageOfPath } from './language-ids.js';
11
- import { PathText } from "./PathText.js";
12
- import { PanelResizeHandle } from "./PanelResizeHandle.js";
13
- import { usePanelBody } from './use-panel-body.js';
14
10
  import { PANEL_BODY_HEIGHT } from './panel-size.js';
15
- import { PEEK_HEIGHT } from './peek.js';
11
+ import { PanelResizeHandle } from "./PanelResizeHandle.js";
12
+ import { basenameOf, relativeTo } from './paths.js';
13
+ import { PathText } from "./PathText.js";
16
14
  import { distinguishingFolders, visualColumnOf } from './peek-model.js';
15
+ import { PEEK_HEIGHT } from './peek.js';
17
16
  import { useEditorRendering } from './rendering-context.js';
17
+ import { usePanelBody } from './use-panel-body.js';
18
18
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
19
19
  const TAB_SIZE = 4;
20
20
  const CODE = 'font-mono text-(length:--code-font-size) [tab-size:4] [&_.line]:block [&_.line]:h-(--code-line-height) [&_.line]:leading-(--code-line-height) [&_pre]:m-0 [&_pre]:bg-transparent! [&_pre]:p-0 [&_pre]:whitespace-pre [&_code]:font-mono';
21
21
  /* The code around the active reference, drawn like the editor's own rows: its gutter, the line the reference is on and the name marked. */
22
22
  export function Preview(t0) {
23
- const $ = _c(51);
23
+ const $ = _c(57);
24
24
  const {
25
25
  preview
26
26
  } = t0;
@@ -99,9 +99,12 @@ export function Preview(t0) {
99
99
  }
100
100
  return t6;
101
101
  }
102
+ let T0;
102
103
  let name;
103
104
  let t10;
104
105
  let t11;
106
+ let t12;
107
+ let t13;
105
108
  let t6;
106
109
  let t7;
107
110
  let t8;
@@ -109,72 +112,81 @@ export function Preview(t0) {
109
112
  if ($[13] !== preview.active || $[14] !== preview.name || $[15] !== preview.startLine || $[16] !== preview.text) {
110
113
  const lines = preview.text.split("\n");
111
114
  name = preview.name === null ? null : columnsOf(lines[preview.active] ?? "", preview.name);
112
- t10 = scroller;
113
- t11 = "relative min-w-0 flex-1 overflow-auto pt-1";
115
+ T0 = ScrollArea;
116
+ t10 = "both";
117
+ t11 = scroller;
118
+ t12 = "flex-1";
119
+ t13 = "relative pt-1";
114
120
  t8 = "relative flex min-w-max";
115
- const t12 = `calc(${preview.active} * var(--code-line-height))`;
116
- if ($[24] !== t12) {
121
+ const t14 = `calc(${preview.active} * var(--code-line-height))`;
122
+ if ($[27] !== t14) {
117
123
  t9 = /*#__PURE__*/_jsx("div", {
118
124
  className: "absolute inset-x-0 bg-surface-hover",
119
125
  style: {
120
- top: t12,
126
+ top: t14,
121
127
  height: "var(--code-line-height)"
122
128
  }
123
129
  });
124
- $[24] = t12;
125
- $[25] = t9;
130
+ $[27] = t14;
131
+ $[28] = t9;
126
132
  } else {
127
- t9 = $[25];
133
+ t9 = $[28];
128
134
  }
129
135
  t6 = "sticky left-0 z-10 w-16 shrink-0 pr-4 text-right font-mono text-(length:--code-font-size) text-text-faint select-none";
130
- let t13;
131
- if ($[26] !== preview.active || $[27] !== preview.startLine) {
132
- t13 = (_, index) => /*#__PURE__*/_jsx("div", {
136
+ let t15;
137
+ if ($[29] !== preview.active || $[30] !== preview.startLine) {
138
+ t15 = (_, index) => /*#__PURE__*/_jsx("div", {
133
139
  className: `h-(--code-line-height) leading-(--code-line-height) ${index === preview.active ? "bg-surface-hover text-text" : "bg-surface"}`,
134
140
  children: preview.startLine + index + 1
135
141
  }, index);
136
- $[26] = preview.active;
137
- $[27] = preview.startLine;
138
- $[28] = t13;
142
+ $[29] = preview.active;
143
+ $[30] = preview.startLine;
144
+ $[31] = t15;
139
145
  } else {
140
- t13 = $[28];
146
+ t15 = $[31];
141
147
  }
142
- t7 = lines.map(t13);
148
+ t7 = lines.map(t15);
143
149
  $[13] = preview.active;
144
150
  $[14] = preview.name;
145
151
  $[15] = preview.startLine;
146
152
  $[16] = preview.text;
147
- $[17] = name;
148
- $[18] = t10;
149
- $[19] = t11;
150
- $[20] = t6;
151
- $[21] = t7;
152
- $[22] = t8;
153
- $[23] = t9;
154
- } else {
155
- name = $[17];
156
- t10 = $[18];
157
- t11 = $[19];
158
- t6 = $[20];
159
- t7 = $[21];
160
- t8 = $[22];
161
- t9 = $[23];
153
+ $[17] = T0;
154
+ $[18] = name;
155
+ $[19] = t10;
156
+ $[20] = t11;
157
+ $[21] = t12;
158
+ $[22] = t13;
159
+ $[23] = t6;
160
+ $[24] = t7;
161
+ $[25] = t8;
162
+ $[26] = t9;
163
+ } else {
164
+ T0 = $[17];
165
+ name = $[18];
166
+ t10 = $[19];
167
+ t11 = $[20];
168
+ t12 = $[21];
169
+ t13 = $[22];
170
+ t6 = $[23];
171
+ t7 = $[24];
172
+ t8 = $[25];
173
+ t9 = $[26];
162
174
  }
163
- let t12;
164
- if ($[29] !== t6 || $[30] !== t7) {
165
- t12 = /*#__PURE__*/_jsx("div", {
175
+ let t14;
176
+ if ($[32] !== t6 || $[33] !== t7) {
177
+ t14 = /*#__PURE__*/_jsx("div", {
166
178
  className: t6,
167
179
  children: t7
168
180
  });
169
- $[29] = t6;
170
- $[30] = t7;
171
- $[31] = t12;
181
+ $[32] = t6;
182
+ $[33] = t7;
183
+ $[34] = t14;
172
184
  } else {
173
- t12 = $[31];
185
+ t14 = $[34];
174
186
  }
175
- let t13;
176
- if ($[32] !== name || $[33] !== preview.active) {
177
- t13 = name !== null && /*#__PURE__*/_jsx("div", {
187
+ let t15;
188
+ if ($[35] !== name || $[36] !== preview.active) {
189
+ t15 = name !== null && /*#__PURE__*/_jsx("div", {
178
190
  className: "absolute rounded-sm bg-(--editor-occurrence) font-mono text-(length:--code-font-size)",
179
191
  style: {
180
192
  top: `calc(${preview.active} * var(--code-line-height))`,
@@ -183,15 +195,15 @@ export function Preview(t0) {
183
195
  width: `${name.end - name.start}ch`
184
196
  }
185
197
  });
186
- $[32] = name;
187
- $[33] = preview.active;
188
- $[34] = t13;
198
+ $[35] = name;
199
+ $[36] = preview.active;
200
+ $[37] = t15;
189
201
  } else {
190
- t13 = $[34];
202
+ t15 = $[37];
191
203
  }
192
- let t14;
193
- if ($[35] !== html || $[36] !== key || $[37] !== preview.text) {
194
- t14 = html?.key === key ? /*#__PURE__*/_jsx("div", {
204
+ let t16;
205
+ if ($[38] !== html || $[39] !== key || $[40] !== preview.text) {
206
+ t16 = html?.key === key ? /*#__PURE__*/_jsx("div", {
195
207
  className: `relative ${CODE}`,
196
208
  dangerouslySetInnerHTML: {
197
209
  __html: html.html
@@ -200,54 +212,59 @@ export function Preview(t0) {
200
212
  className: `relative ${CODE} whitespace-pre`,
201
213
  children: preview.text
202
214
  });
203
- $[35] = html;
204
- $[36] = key;
205
- $[37] = preview.text;
206
- $[38] = t14;
215
+ $[38] = html;
216
+ $[39] = key;
217
+ $[40] = preview.text;
218
+ $[41] = t16;
207
219
  } else {
208
- t14 = $[38];
220
+ t16 = $[41];
209
221
  }
210
- let t15;
211
- if ($[39] !== t13 || $[40] !== t14) {
212
- t15 = /*#__PURE__*/_jsxs("div", {
222
+ let t17;
223
+ if ($[42] !== t15 || $[43] !== t16) {
224
+ t17 = /*#__PURE__*/_jsxs("div", {
213
225
  className: "relative",
214
- children: [t13, t14]
226
+ children: [t15, t16]
215
227
  });
216
- $[39] = t13;
217
- $[40] = t14;
218
- $[41] = t15;
228
+ $[42] = t15;
229
+ $[43] = t16;
230
+ $[44] = t17;
219
231
  } else {
220
- t15 = $[41];
232
+ t17 = $[44];
221
233
  }
222
- let t16;
223
- if ($[42] !== t12 || $[43] !== t15 || $[44] !== t8 || $[45] !== t9) {
224
- t16 = /*#__PURE__*/_jsxs("div", {
234
+ let t18;
235
+ if ($[45] !== t14 || $[46] !== t17 || $[47] !== t8 || $[48] !== t9) {
236
+ t18 = /*#__PURE__*/_jsxs("div", {
225
237
  className: t8,
226
- children: [t9, t12, t15]
238
+ children: [t9, t14, t17]
227
239
  });
228
- $[42] = t12;
229
- $[43] = t15;
230
- $[44] = t8;
231
- $[45] = t9;
232
- $[46] = t16;
240
+ $[45] = t14;
241
+ $[46] = t17;
242
+ $[47] = t8;
243
+ $[48] = t9;
244
+ $[49] = t18;
233
245
  } else {
234
- t16 = $[46];
246
+ t18 = $[49];
235
247
  }
236
- let t17;
237
- if ($[47] !== t10 || $[48] !== t11 || $[49] !== t16) {
238
- t17 = /*#__PURE__*/_jsx("div", {
239
- ref: t10,
240
- className: t11,
241
- children: t16
248
+ let t19;
249
+ if ($[50] !== T0 || $[51] !== t10 || $[52] !== t11 || $[53] !== t12 || $[54] !== t13 || $[55] !== t18) {
250
+ t19 = /*#__PURE__*/_jsx(T0, {
251
+ axis: t10,
252
+ viewportRef: t11,
253
+ className: t12,
254
+ viewportClassName: t13,
255
+ children: t18
242
256
  });
243
- $[47] = t10;
244
- $[48] = t11;
245
- $[49] = t16;
246
- $[50] = t17;
257
+ $[50] = T0;
258
+ $[51] = t10;
259
+ $[52] = t11;
260
+ $[53] = t12;
261
+ $[54] = t13;
262
+ $[55] = t18;
263
+ $[56] = t19;
247
264
  } else {
248
- t17 = $[50];
265
+ t19 = $[56];
249
266
  }
250
- return t17;
267
+ return t19;
251
268
  }
252
269
  /* The name's stretch of a line in monospace columns, which is what the code is laid out in. */
253
270
  function _temp() {}
@@ -354,7 +371,7 @@ function PlaceText(t0) {
354
371
  return t5;
355
372
  }
356
373
  function Places(t0) {
357
- const $ = _c(7);
374
+ const $ = _c(8);
358
375
  const {
359
376
  language,
360
377
  view
@@ -394,8 +411,10 @@ function Places(t0) {
394
411
  t3 = $[4];
395
412
  }
396
413
  useEffect(t2, t3);
397
- const t4 = "w-1/3 shrink-0 overflow-y-auto border-l border-border py-1";
398
- const t5 = view.files.map((file_0, fileIndex) => {
414
+ const T0 = ScrollArea;
415
+ const t4 = "w-1/3 shrink-0 border-l border-border";
416
+ const t5 = "py-1";
417
+ const t6 = view.files.map((file_0, fileIndex) => {
399
418
  const collapsed = view.collapsed.includes(file_0.uri);
400
419
  return /*#__PURE__*/_jsxs("div", {
401
420
  children: [/*#__PURE__*/_jsx(Tooltip, {
@@ -436,18 +455,20 @@ function Places(t0) {
436
455
  }, place.id))]
437
456
  }, file_0.uri);
438
457
  });
439
- let t6;
440
- if ($[5] !== t5) {
441
- t6 = /*#__PURE__*/_jsx("div", {
458
+ let t7;
459
+ if ($[5] !== T0 || $[6] !== t6) {
460
+ t7 = /*#__PURE__*/_jsx(T0, {
442
461
  className: t4,
443
- children: t5
462
+ viewportClassName: t5,
463
+ children: t6
444
464
  });
445
- $[5] = t5;
465
+ $[5] = T0;
446
466
  $[6] = t6;
467
+ $[7] = t7;
447
468
  } else {
448
- t6 = $[6];
469
+ t7 = $[7];
449
470
  }
450
- return t6;
471
+ return t7;
451
472
  }
452
473
  /*
453
474
  * The references of a name in the row the editor leaves under the line: the code around the active one on
package/dist/PickPopup.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
+ import { ScrollArea } from '@adecore/ui';
2
3
  import { useId, useLayoutEffect, useRef } from 'react';
3
4
  import { createPortal } from 'react-dom';
4
5
  import { PathText } from "./PathText.js";
@@ -99,8 +100,10 @@ function PreviewLines(t0) {
99
100
  }
100
101
  let t2;
101
102
  if ($[2] !== t1) {
102
- t2 = /*#__PURE__*/_jsx("div", {
103
- className: "max-h-48 overflow-auto border-t border-border p-2 font-mono text-code whitespace-pre",
103
+ t2 = /*#__PURE__*/_jsx(ScrollArea, {
104
+ axis: "both",
105
+ className: "max-h-48 border-t border-border",
106
+ viewportClassName: "p-2 font-mono text-code whitespace-pre",
104
107
  children: t1
105
108
  });
106
109
  $[2] = t1;
@@ -379,10 +382,11 @@ export function PickPopup(t0) {
379
382
  }
380
383
  let t10;
381
384
  if ($[27] !== listId || $[28] !== t9) {
382
- t10 = /*#__PURE__*/_jsx("div", {
385
+ t10 = /*#__PURE__*/_jsx(ScrollArea, {
383
386
  id: listId,
384
387
  role: "listbox",
385
- className: "min-h-0 flex-1 overflow-y-auto p-1",
388
+ className: "flex-1",
389
+ viewportClassName: "p-1",
386
390
  children: t9
387
391
  });
388
392
  $[27] = listId;
@@ -1,13 +1,13 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
+ import { fileUriToPath } from '@adecore/lsp';
3
+ import { Button, Icon, ScrollArea } from '@adecore/ui';
4
+ import { formatNumber } from '@adecore/ui/format';
5
+ import { Sparkles } from 'lucide-react';
2
6
  import { useLayoutEffect, useRef, useState } from 'react';
3
7
  import { createPortal } from 'react-dom';
4
8
  import { useTranslation } from 'react-i18next';
5
- import { Sparkles } from 'lucide-react';
6
- import { fileUriToPath } from '@adecore/lsp';
7
- import { Button, Icon } from '@adecore/ui';
8
- import { formatNumber } from '@adecore/ui/format';
9
- import { basenameOf, relativeTo } from './paths.js';
10
9
  import { AnchoredPopup } from "./AnchoredPopup.js";
10
+ import { basenameOf, relativeTo } from './paths.js';
11
11
  import { keepFocusOutOfList } from './popup-focus.js';
12
12
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
13
13
  const CARD_ATTRIBUTE = 'data-rename-card';
@@ -327,8 +327,8 @@ function Preview(t0) {
327
327
  }
328
328
  let t5;
329
329
  if ($[13] !== t3 || $[14] !== t4) {
330
- t5 = /*#__PURE__*/_jsxs("div", {
331
- className: "max-h-[320px] overflow-y-auto",
330
+ t5 = /*#__PURE__*/_jsxs(ScrollArea, {
331
+ className: "max-h-[320px]",
332
332
  children: [t3, t4]
333
333
  });
334
334
  $[13] = t3;
@@ -1,6 +1,6 @@
1
1
  import type { DocComment } from '@adecore/editor';
2
- import type { EditorLanguage } from './editor-language.ts';
3
2
  import { type ParsedDocComment } from './doc-comment-model.ts';
3
+ import type { EditorLanguage } from './editor-language.ts';
4
4
  interface DocBlockProps {
5
5
  language: EditorLanguage;
6
6
  comment: DocComment;
@@ -1,6 +1,6 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
- import { createPortal } from 'react-dom';
3
2
  import { memo, useSyncExternalStore } from 'react';
3
+ import { createPortal } from 'react-dom';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import { DOC_LINK_PREFIX, sectionsOf } from './doc-comment-model.js';
6
6
  import { markdownParts } from './hover-content.js';
@@ -1,15 +1,20 @@
1
- import { useLayoutEffect, useMemo, useRef, useState } from 'react';
2
- import { useTranslation } from 'react-i18next';
3
1
  import { parseChord } from '@adecore/editor/keymap';
4
2
  import { sourceLineOf } from '@adecore/merge';
5
- import { repaintOnTokens } from './diff-syntax.js';
3
+ import { useOverlayScrollbars } from '@adecore/ui';
4
+ import { useLayoutEffect, useMemo, useRef, useState } from 'react';
5
+ import { useTranslation } from 'react-i18next';
6
6
  import { DiffOverlays } from "./diff-overlays.js";
7
+ import { repaintOnTokens } from './diff-syntax.js';
7
8
  import { wordMarks } from './diff-wordmarks.js';
8
9
  import { RowHost, LineActionHost } from './row-host.js';
9
10
  import { splitAlignment } from './split-alignment.js';
10
11
  import { SplitScroll } from './split-scroll.js';
11
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
13
  const SIDES = ['old', 'new'];
14
+ const NO_SCROLLERS = {
15
+ old: null,
16
+ new: null
17
+ };
13
18
  export function SplitDiffView({
14
19
  engine,
15
20
  document,
@@ -50,6 +55,13 @@ export function SplitDiffView({
50
55
  const [failure, setFailure] = useState(null);
51
56
  const [mounted, setMounted] = useState(null);
52
57
  const [height, setHeight] = useState(0);
58
+ const [scrollers, setScrollers] = useState(NO_SCROLLERS);
59
+ const oldScrollbars = useOverlayScrollbars(scrollers.old, {
60
+ axis: 'both'
61
+ });
62
+ const newScrollbars = useOverlayScrollbars(scrollers.new, {
63
+ axis: 'both'
64
+ });
53
65
  useLayoutEffect(() => {
54
66
  current.current = {
55
67
  document,
@@ -182,9 +194,14 @@ export function SplitDiffView({
182
194
  update,
183
195
  drive: side_1 => scroll.drive(side_1)
184
196
  });
197
+ setScrollers({
198
+ old: oldHost.querySelector('.se-viewport'),
199
+ new: newHost.querySelector('.se-viewport')
200
+ });
185
201
  measure();
186
202
  return () => {
187
203
  stopped = true;
204
+ setScrollers(NO_SCROLLERS);
188
205
  for (const stop of stops) {
189
206
  stop();
190
207
  }
@@ -357,7 +374,7 @@ export function SplitDiffView({
357
374
  children: [/*#__PURE__*/_jsx("div", {
358
375
  ref: side_10 === 'old' ? oldElement : newElement,
359
376
  className: "adecore-editor-diff-surface"
360
- }), mounted !== null && mounted[side_10].engine === engine && /*#__PURE__*/_jsx(DiffOverlays, {
377
+ }), side_10 === 'old' ? oldScrollbars : newScrollbars, mounted !== null && mounted[side_10].engine === engine && /*#__PURE__*/_jsx(DiffOverlays, {
361
378
  mounted: mounted[side_10],
362
379
  display: display[side_10],
363
380
  unfold: unfold,