@adecore/editor-react 0.38.0 → 0.40.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 (154) hide show
  1. package/dist/CallHierarchyPanel.js +30 -55
  2. package/dist/CodeAuthorsCard.js +0 -1
  3. package/dist/CompletionPopup.js +150 -181
  4. package/dist/DiffView.d.ts +1 -1
  5. package/dist/DiffView.js +2 -29
  6. package/dist/PickPopup.js +54 -80
  7. package/dist/SplitDiffView.js +27 -57
  8. package/dist/SymbolPicker.js +2 -8
  9. package/dist/code-actions-model.js +2 -9
  10. package/dist/code-actions.js +10 -11
  11. package/dist/code-vision.js +2 -1
  12. package/dist/completion-model.js +2 -2
  13. package/dist/completion.js +13 -34
  14. package/dist/definition-link.d.ts +1 -0
  15. package/dist/definition-link.js +22 -18
  16. package/dist/diagnostics-model.d.ts +1 -0
  17. package/dist/diagnostics-model.js +3 -1
  18. package/dist/diagnostics.js +1 -2
  19. package/dist/diff-syntax.d.ts +1 -0
  20. package/dist/diff-syntax.js +31 -0
  21. package/dist/doc-comment-model.d.ts +1 -0
  22. package/dist/doc-comment-model.js +1 -1
  23. package/dist/folding.js +2 -3
  24. package/dist/format-on-type.js +6 -10
  25. package/dist/hover-content.d.ts +0 -2
  26. package/dist/hover-content.js +1 -9
  27. package/dist/inlay-hints.d.ts +0 -1
  28. package/dist/inlay-hints.js +11 -41
  29. package/dist/navigation.js +4 -14
  30. package/dist/peek.js +2 -12
  31. package/dist/popup-focus.d.ts +3 -1
  32. package/dist/popup-focus.js +33 -0
  33. package/dist/recent-choices.d.ts +0 -1
  34. package/dist/recent-choices.js +0 -4
  35. package/dist/rendered-docs.d.ts +1 -0
  36. package/dist/rendered-docs.js +15 -28
  37. package/dist/snippet-field-transforms.d.ts +5 -0
  38. package/dist/snippet-field-transforms.js +27 -16
  39. package/dist/snippet-session.js +8 -20
  40. package/dist/symbol-links.js +3 -10
  41. package/dist/symbol-picker-model.d.ts +1 -0
  42. package/dist/symbol-picker-model.js +7 -0
  43. package/dist/unique.d.ts +10 -0
  44. package/dist/unique.js +15 -0
  45. package/package.json +9 -9
  46. package/src/AnchoredPopup.tsx +2 -0
  47. package/src/BaselineStatus.tsx +1 -0
  48. package/src/CallHierarchyPanel.tsx +16 -6
  49. package/src/ChangeReview.tsx +7 -0
  50. package/src/CodeAuthorsCard.tsx +2 -5
  51. package/src/CompletionPopup.tsx +21 -15
  52. package/src/DiffView.tsx +53 -30
  53. package/src/EditorContextMenu.tsx +7 -0
  54. package/src/EditorView.tsx +28 -0
  55. package/src/FindReplace.tsx +8 -0
  56. package/src/HoverCard.tsx +8 -0
  57. package/src/HoverSections.tsx +11 -0
  58. package/src/LanguagePopups.tsx +1 -0
  59. package/src/PanelResizeHandle.tsx +8 -0
  60. package/src/PathText.tsx +1 -0
  61. package/src/PeekPanel.tsx +13 -0
  62. package/src/PickPopup.tsx +7 -6
  63. package/src/RenameCard.tsx +13 -0
  64. package/src/RenderedDocs.tsx +11 -0
  65. package/src/SplitDiffView.tsx +91 -56
  66. package/src/SymbolPicker.tsx +10 -18
  67. package/src/call-hierarchy-model.ts +10 -0
  68. package/src/call-hierarchy.ts +82 -0
  69. package/src/code-actions-model.ts +21 -9
  70. package/src/code-actions.ts +83 -7
  71. package/src/code-authors.ts +20 -0
  72. package/src/code-vision-model.ts +37 -0
  73. package/src/code-vision.ts +47 -3
  74. package/src/completion-call.ts +19 -0
  75. package/src/completion-model.ts +58 -2
  76. package/src/completion.ts +156 -30
  77. package/src/conflict-model.ts +4 -0
  78. package/src/context-menu-rows.ts +1 -0
  79. package/src/context-menu.ts +7 -0
  80. package/src/definition-link.ts +42 -18
  81. package/src/diagnostics-model.ts +19 -1
  82. package/src/diagnostics.ts +31 -2
  83. package/src/diff-expansion.ts +9 -0
  84. package/src/diff-overlays.tsx +8 -0
  85. package/src/diff-syntax.ts +54 -0
  86. package/src/diff-wordmarks.ts +8 -0
  87. package/src/doc-comment-model.ts +51 -1
  88. package/src/editor-language.ts +11 -0
  89. package/src/find-query.ts +7 -0
  90. package/src/folding.ts +10 -3
  91. package/src/format-on-type.ts +23 -10
  92. package/src/highlight-layers.ts +3 -0
  93. package/src/highlights.ts +18 -0
  94. package/src/history.ts +11 -0
  95. package/src/holder.ts +3 -0
  96. package/src/hover-content.ts +34 -17
  97. package/src/hover.ts +57 -0
  98. package/src/index.ts +4 -0
  99. package/src/inlay-hints.ts +86 -47
  100. package/src/key-priority.ts +2 -0
  101. package/src/line-edits.ts +8 -0
  102. package/src/models.ts +6 -0
  103. package/src/navigation-history.ts +5 -0
  104. package/src/navigation.ts +28 -13
  105. package/src/panel-size.ts +7 -0
  106. package/src/patch-decorations.ts +39 -0
  107. package/src/patch-layout.ts +47 -0
  108. package/src/peek-model.ts +21 -0
  109. package/src/peek.ts +49 -13
  110. package/src/pick.ts +35 -0
  111. package/src/popup-focus.ts +11 -1
  112. package/src/popup-placement.ts +5 -0
  113. package/src/popups.ts +2 -6
  114. package/src/project-language.ts +33 -0
  115. package/src/project-problems.ts +11 -0
  116. package/src/proposal-model.ts +40 -0
  117. package/src/recent-choices.ts +3 -5
  118. package/src/refresher.ts +3 -0
  119. package/src/rename-model.ts +28 -0
  120. package/src/rename.ts +56 -0
  121. package/src/rendered-docs.ts +89 -19
  122. package/src/review-group.ts +4 -0
  123. package/src/row-host.ts +12 -0
  124. package/src/selection-ranges.ts +6 -0
  125. package/src/semantic-delta.ts +7 -0
  126. package/src/semantic-model.ts +11 -0
  127. package/src/semantic-tokens.ts +37 -0
  128. package/src/shortcut-keys.ts +3 -0
  129. package/src/signature-model.ts +7 -0
  130. package/src/signature.ts +27 -0
  131. package/src/snippet-field-transforms.ts +48 -13
  132. package/src/snippet-indent.ts +10 -0
  133. package/src/snippet-range-order.ts +5 -0
  134. package/src/snippet-session.ts +173 -31
  135. package/src/snippet-transform-client.ts +14 -0
  136. package/src/snippet-transform-format.ts +98 -0
  137. package/src/snippet-transform-protocol.ts +5 -0
  138. package/src/snippet-transform-queue.ts +53 -0
  139. package/src/snippet-transform-worker.ts +14 -0
  140. package/src/snippet-variables.ts +9 -0
  141. package/src/snippet.ts +107 -0
  142. package/src/split-alignment.ts +10 -0
  143. package/src/split-scroll.ts +8 -0
  144. package/src/symbol-links.ts +9 -12
  145. package/src/symbol-picker-model.ts +25 -0
  146. package/src/symbol-picker.ts +9 -0
  147. package/src/symbols.ts +21 -0
  148. package/src/testing.ts +7 -0
  149. package/src/timers.ts +5 -0
  150. package/src/unique.ts +23 -0
  151. package/src/use-problem-counts.ts +4 -0
  152. package/src/view-state.ts +9 -0
  153. package/src/word-diff.ts +5 -0
  154. package/src/workspace-edit.ts +84 -0
@@ -1,5 +1,5 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
- import { useEffect, useId, useLayoutEffect, useRef } from 'react';
2
+ import { useEffect, useId, useRef } from 'react';
3
3
  import { createPortal } from 'react-dom';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import { ChevronDown, ChevronLeft, ChevronRight, X } from 'lucide-react';
@@ -15,6 +15,7 @@ import { basenameOf, relativeTo } from './paths.js';
15
15
  import { PathText } from "./PathText.js";
16
16
  import { Preview } from "./PeekPanel.js";
17
17
  import { SymbolBadge } from "./SymbolPicker.js";
18
+ import { useInputPopup } from './popup-focus.js';
18
19
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
19
20
  const INDENT = 14;
20
21
  const BASE_INDENT = 8;
@@ -376,7 +377,7 @@ function SymbolRow(t0) {
376
377
  return t25;
377
378
  }
378
379
  function Tree(t0) {
379
- const $ = _c(30);
380
+ const $ = _c(22);
380
381
  const {
381
382
  language,
382
383
  view
@@ -426,44 +427,18 @@ function Tree(t0) {
426
427
  t4 = $[8];
427
428
  }
428
429
  useEffect(t3, t4);
430
+ useInputPopup(language, treeId, activeId);
429
431
  let t5;
430
- if ($[9] !== activeId || $[10] !== language.editor || $[11] !== treeId) {
431
- t5 = () => {
432
- language.editor.setInputPopup({
433
- controls: treeId,
434
- activeDescendant: activeId
435
- });
436
- return () => language.editor.setInputPopup(null);
437
- };
438
- $[9] = activeId;
439
- $[10] = language.editor;
440
- $[11] = treeId;
441
- $[12] = t5;
432
+ if ($[9] !== t) {
433
+ t5 = t("language.callHierarchy.label");
434
+ $[9] = t;
435
+ $[10] = t5;
442
436
  } else {
443
- t5 = $[12];
437
+ t5 = $[10];
444
438
  }
445
439
  let t6;
446
- if ($[13] !== activeId || $[14] !== language || $[15] !== treeId) {
447
- t6 = [language, treeId, activeId];
448
- $[13] = activeId;
449
- $[14] = language;
450
- $[15] = treeId;
451
- $[16] = t6;
452
- } else {
453
- t6 = $[16];
454
- }
455
- useLayoutEffect(t5, t6);
456
- let t7;
457
- if ($[17] !== t) {
458
- t7 = t("language.callHierarchy.label");
459
- $[17] = t;
460
- $[18] = t7;
461
- } else {
462
- t7 = $[18];
463
- }
464
- let t8;
465
- if ($[19] !== idOf || $[20] !== language || $[21] !== t || $[22] !== view.active || $[23] !== view.direction || $[24] !== view.rows) {
466
- t8 = view.rows.map(row_1 => {
440
+ if ($[11] !== idOf || $[12] !== language || $[13] !== t || $[14] !== view.active || $[15] !== view.direction || $[16] !== view.rows) {
441
+ t6 = view.rows.map(row_1 => {
467
442
  const active = row_1.id === view.active;
468
443
  const ref = active ? activeRow : undefined;
469
444
  if (row_1.kind === "node") {
@@ -504,33 +479,33 @@ function Tree(t0) {
504
479
  })
505
480
  }, row_1.id);
506
481
  });
507
- $[19] = idOf;
508
- $[20] = language;
509
- $[21] = t;
510
- $[22] = view.active;
511
- $[23] = view.direction;
512
- $[24] = view.rows;
513
- $[25] = t8;
482
+ $[11] = idOf;
483
+ $[12] = language;
484
+ $[13] = t;
485
+ $[14] = view.active;
486
+ $[15] = view.direction;
487
+ $[16] = view.rows;
488
+ $[17] = t6;
514
489
  } else {
515
- t8 = $[25];
490
+ t6 = $[17];
516
491
  }
517
- let t9;
518
- if ($[26] !== t7 || $[27] !== t8 || $[28] !== treeId) {
519
- t9 = /*#__PURE__*/_jsx("div", {
492
+ let t7;
493
+ if ($[18] !== t5 || $[19] !== t6 || $[20] !== treeId) {
494
+ t7 = /*#__PURE__*/_jsx("div", {
520
495
  id: treeId,
521
496
  role: "tree",
522
- "aria-label": t7,
497
+ "aria-label": t5,
523
498
  className: "w-1/2 shrink-0 overflow-y-auto border-r border-border py-1",
524
- children: t8
499
+ children: t6
525
500
  });
526
- $[26] = t7;
527
- $[27] = t8;
528
- $[28] = treeId;
529
- $[29] = t9;
501
+ $[18] = t5;
502
+ $[19] = t6;
503
+ $[20] = treeId;
504
+ $[21] = t7;
530
505
  } else {
531
- t9 = $[29];
506
+ t7 = $[21];
532
507
  }
533
- return t9;
508
+ return t7;
534
509
  }
535
510
  function StatusText(t0) {
536
511
  const $ = _c(15);
@@ -1,5 +1,4 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
- import { useMemo } from 'react';
3
2
  import { useTranslation } from 'react-i18next';
4
3
  import { GitCommitHorizontal, User, Users } from 'lucide-react';
5
4
  import { Button, Icon, Popover, Separator, Tooltip, useNow } from '@adecore/ui';
@@ -6,16 +6,11 @@ import { formatShortcut } from '@adecore/ui';
6
6
  import { kindLetterOf, kindToneOf, rowWindow } from './completion-model.js';
7
7
  import { SourceLine, SymbolSections } from "./HoverSections.js";
8
8
  import { PathText } from "./PathText.js";
9
- import { keepFocusOutOfList } from './popup-focus.js';
9
+ import { keepFocusOutOfList, useInputPopup } from './popup-focus.js';
10
10
  import { placeBeside, placePopup } from './popup-placement.js';
11
- import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
- const TONES = {
13
- callable: 'bg-accent-soft text-accent',
14
- value: 'bg-status-running/15 text-status-running',
15
- type: 'bg-status-idle/15 text-status-idle',
16
- other: 'bg-surface-hover text-text-muted'
17
- };
11
+ import { TONE_CLASSES } from './symbol-picker-model.js';
18
12
  /* The label with the characters that match what was typed set apart. */
13
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
19
14
  function MarkedLabel(t0) {
20
15
  const $ = _c(7);
21
16
  const {
@@ -91,7 +86,7 @@ const ROW_CHROME = 72;
91
86
  * press on a row never takes the focus from the editor, so typing goes on while the list is open.
92
87
  */
93
88
  export function CompletionPopup(t0) {
94
- const $ = _c(78);
89
+ const $ = _c(70);
95
90
  const {
96
91
  language,
97
92
  view,
@@ -219,95 +214,69 @@ export function CompletionPopup(t0) {
219
214
  }
220
215
  const optionId = t7;
221
216
  const activeId = view.active >= first && view.active < last ? optionId(view.active) : undefined;
217
+ useInputPopup(language, listId, activeId);
222
218
  let t8;
223
- if ($[16] !== activeId || $[17] !== language.editor || $[18] !== listId) {
224
- t8 = () => {
225
- language.editor.setInputPopup({
226
- controls: listId,
227
- activeDescendant: activeId
228
- });
229
- return () => language.editor.setInputPopup(null);
219
+ if ($[16] === Symbol.for("react.memo_cache_sentinel")) {
220
+ t8 = {
221
+ visibility: "hidden"
230
222
  };
231
- $[16] = activeId;
232
- $[17] = language.editor;
233
- $[18] = listId;
234
- $[19] = t8;
223
+ $[16] = t8;
235
224
  } else {
236
- t8 = $[19];
225
+ t8 = $[16];
237
226
  }
238
227
  let t9;
239
- if ($[20] !== activeId || $[21] !== language || $[22] !== listId) {
240
- t9 = [language, listId, activeId];
241
- $[20] = activeId;
242
- $[21] = language;
243
- $[22] = listId;
244
- $[23] = t9;
245
- } else {
246
- t9 = $[23];
247
- }
248
- useLayoutEffect(t8, t9);
249
- let t10;
250
- if ($[24] === Symbol.for("react.memo_cache_sentinel")) {
251
- t10 = {
252
- visibility: "hidden"
253
- };
254
- $[24] = t10;
228
+ if ($[17] !== language.editor) {
229
+ t9 = keepFocusOutOfList(() => language.editor.focus());
230
+ $[17] = language.editor;
231
+ $[18] = t9;
255
232
  } else {
256
- t10 = $[24];
233
+ t9 = $[18];
257
234
  }
235
+ const t10 = `calc(${Math.max(widest, need)}ch + ${ROW_CHROME}px)`;
258
236
  let t11;
259
- if ($[25] !== language.editor) {
260
- t11 = keepFocusOutOfList(() => language.editor.focus());
261
- $[25] = language.editor;
262
- $[26] = t11;
263
- } else {
264
- t11 = $[26];
265
- }
266
- const t12 = `calc(${Math.max(widest, need)}ch + ${ROW_CHROME}px)`;
267
- let t13;
268
- if ($[27] !== t12) {
269
- t13 = /*#__PURE__*/_jsx("div", {
237
+ if ($[19] !== t10) {
238
+ t11 = /*#__PURE__*/_jsx("div", {
270
239
  "aria-hidden": true,
271
240
  className: "h-0 overflow-hidden font-mono text-code",
272
241
  style: {
273
- width: t12
242
+ width: t10
274
243
  }
275
244
  });
276
- $[27] = t12;
277
- $[28] = t13;
245
+ $[19] = t10;
246
+ $[20] = t11;
278
247
  } else {
279
- t13 = $[28];
248
+ t11 = $[20];
280
249
  }
281
- let t14;
282
- let t15;
283
- if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
284
- t14 = {
250
+ let t12;
251
+ let t13;
252
+ if ($[21] === Symbol.for("react.memo_cache_sentinel")) {
253
+ t12 = {
285
254
  maxHeight: ROW_HEIGHT * VISIBLE_ROWS + 8
286
255
  };
287
- t15 = event_0 => setListTop(event_0.currentTarget.scrollTop);
288
- $[29] = t14;
289
- $[30] = t15;
256
+ t13 = event_0 => setListTop(event_0.currentTarget.scrollTop);
257
+ $[21] = t12;
258
+ $[22] = t13;
290
259
  } else {
291
- t14 = $[29];
292
- t15 = $[30];
260
+ t12 = $[21];
261
+ t13 = $[22];
293
262
  }
294
- const t16 = first * ROW_HEIGHT;
295
- let t17;
296
- if ($[31] !== t16) {
297
- t17 = /*#__PURE__*/_jsx("div", {
263
+ const t14 = first * ROW_HEIGHT;
264
+ let t15;
265
+ if ($[23] !== t14) {
266
+ t15 = /*#__PURE__*/_jsx("div", {
298
267
  "aria-hidden": true,
299
268
  style: {
300
- height: t16
269
+ height: t14
301
270
  }
302
271
  });
303
- $[31] = t16;
304
- $[32] = t17;
272
+ $[23] = t14;
273
+ $[24] = t15;
305
274
  } else {
306
- t17 = $[32];
275
+ t15 = $[24];
307
276
  }
308
- let t18;
309
- if ($[33] !== first || $[34] !== language.completion || $[35] !== last || $[36] !== optionId || $[37] !== total || $[38] !== view.active || $[39] !== view.rows) {
310
- t18 = view.rows.slice(first, last).map((row_0, offset) => {
277
+ let t16;
278
+ if ($[25] !== first || $[26] !== language.completion || $[27] !== last || $[28] !== optionId || $[29] !== total || $[30] !== view.active || $[31] !== view.rows) {
279
+ t16 = view.rows.slice(first, last).map((row_0, offset) => {
311
280
  const index_0 = first + offset;
312
281
  return /*#__PURE__*/_jsxs("button", {
313
282
  id: optionId(index_0),
@@ -322,7 +291,7 @@ export function CompletionPopup(t0) {
322
291
  className: "flex h-6 w-full items-center gap-2 overflow-hidden rounded-md px-1.5 text-left text-xs cursor-row",
323
292
  onClick: () => void language.completion.accept(false, index_0),
324
293
  children: [/*#__PURE__*/_jsx("span", {
325
- className: `grid size-4 shrink-0 place-items-center rounded-sm font-mono text-xs leading-none font-semibold ${TONES[kindToneOf(row_0.kind)]}`,
294
+ className: `grid size-4 shrink-0 place-items-center rounded-sm font-mono text-xs leading-none font-semibold ${TONE_CLASSES[kindToneOf(row_0.kind)]}`,
326
295
  children: kindLetterOf(row_0.kind)
327
296
  }), /*#__PURE__*/_jsx("span", {
328
297
  className: `max-w-full shrink-0 truncate font-mono text-code ${row_0.deprecated ? "line-through" : ""}`,
@@ -339,142 +308,142 @@ export function CompletionPopup(t0) {
339
308
  })]
340
309
  }, `${index_0}:${row_0.label}`);
341
310
  });
342
- $[33] = first;
343
- $[34] = language.completion;
344
- $[35] = last;
345
- $[36] = optionId;
346
- $[37] = total;
347
- $[38] = view.active;
348
- $[39] = view.rows;
349
- $[40] = t18;
311
+ $[25] = first;
312
+ $[26] = language.completion;
313
+ $[27] = last;
314
+ $[28] = optionId;
315
+ $[29] = total;
316
+ $[30] = view.active;
317
+ $[31] = view.rows;
318
+ $[32] = t16;
350
319
  } else {
351
- t18 = $[40];
320
+ t16 = $[32];
352
321
  }
353
- const t19 = (total - last) * ROW_HEIGHT;
354
- let t20;
355
- if ($[41] !== t19) {
356
- t20 = /*#__PURE__*/_jsx("div", {
322
+ const t17 = (total - last) * ROW_HEIGHT;
323
+ let t18;
324
+ if ($[33] !== t17) {
325
+ t18 = /*#__PURE__*/_jsx("div", {
357
326
  "aria-hidden": true,
358
327
  style: {
359
- height: t19
328
+ height: t17
360
329
  }
361
330
  });
362
- $[41] = t19;
363
- $[42] = t20;
331
+ $[33] = t17;
332
+ $[34] = t18;
364
333
  } else {
365
- t20 = $[42];
334
+ t18 = $[34];
366
335
  }
367
- let t21;
368
- if ($[43] !== listId || $[44] !== t17 || $[45] !== t18 || $[46] !== t20) {
369
- t21 = /*#__PURE__*/_jsxs("div", {
336
+ let t19;
337
+ if ($[35] !== listId || $[36] !== t15 || $[37] !== t16 || $[38] !== t18) {
338
+ t19 = /*#__PURE__*/_jsxs("div", {
370
339
  id: listId,
371
340
  role: "listbox",
372
341
  className: "w-0 min-w-full overflow-y-auto p-1",
373
- style: t14,
374
- onScroll: t15,
375
- children: [t17, t18, t20]
342
+ style: t12,
343
+ onScroll: t13,
344
+ children: [t15, t16, t18]
376
345
  });
377
- $[43] = listId;
378
- $[44] = t17;
379
- $[45] = t18;
380
- $[46] = t20;
381
- $[47] = t21;
346
+ $[35] = listId;
347
+ $[36] = t15;
348
+ $[37] = t16;
349
+ $[38] = t18;
350
+ $[39] = t19;
382
351
  } else {
383
- t21 = $[47];
352
+ t19 = $[39];
384
353
  }
385
- let t22;
386
- if ($[48] !== t) {
387
- t22 = t("language.completion.insert");
388
- $[48] = t;
389
- $[49] = t22;
354
+ let t20;
355
+ if ($[40] !== t) {
356
+ t20 = t("language.completion.insert");
357
+ $[40] = t;
358
+ $[41] = t20;
390
359
  } else {
391
- t22 = $[49];
360
+ t20 = $[41];
392
361
  }
393
- let t23;
394
- if ($[50] !== t22) {
395
- t23 = /*#__PURE__*/_jsxs("span", {
396
- children: ["\u21B5 ", t22]
362
+ let t21;
363
+ if ($[42] !== t20) {
364
+ t21 = /*#__PURE__*/_jsxs("span", {
365
+ children: ["\u21B5 ", t20]
397
366
  });
398
- $[50] = t22;
399
- $[51] = t23;
367
+ $[42] = t20;
368
+ $[43] = t21;
400
369
  } else {
401
- t23 = $[51];
370
+ t21 = $[43];
402
371
  }
403
- let t24;
404
- if ($[52] !== t) {
405
- t24 = t("language.completion.replace");
406
- $[52] = t;
407
- $[53] = t24;
372
+ let t22;
373
+ if ($[44] !== t) {
374
+ t22 = t("language.completion.replace");
375
+ $[44] = t;
376
+ $[45] = t22;
408
377
  } else {
409
- t24 = $[53];
378
+ t22 = $[45];
410
379
  }
411
- let t25;
412
- if ($[54] !== t24) {
413
- t25 = /*#__PURE__*/_jsxs("span", {
414
- children: ["\u21E5 ", t24]
380
+ let t23;
381
+ if ($[46] !== t22) {
382
+ t23 = /*#__PURE__*/_jsxs("span", {
383
+ children: ["\u21E5 ", t22]
415
384
  });
416
- $[54] = t24;
417
- $[55] = t25;
385
+ $[46] = t22;
386
+ $[47] = t23;
418
387
  } else {
419
- t25 = $[55];
388
+ t23 = $[47];
420
389
  }
421
- let t26;
422
- if ($[56] !== detailsKey || $[57] !== t) {
423
- t26 = detailsKey !== null && /*#__PURE__*/_jsxs("span", {
390
+ let t24;
391
+ if ($[48] !== detailsKey || $[49] !== t) {
392
+ t24 = detailsKey !== null && /*#__PURE__*/_jsxs("span", {
424
393
  children: [detailsKey, " ", t("language.completion.details")]
425
394
  });
426
- $[56] = detailsKey;
427
- $[57] = t;
428
- $[58] = t26;
395
+ $[48] = detailsKey;
396
+ $[49] = t;
397
+ $[50] = t24;
429
398
  } else {
430
- t26 = $[58];
399
+ t24 = $[50];
431
400
  }
432
- let t27;
433
- if ($[59] !== view.server) {
434
- t27 = /*#__PURE__*/_jsx("span", {
401
+ let t25;
402
+ if ($[51] !== view.server) {
403
+ t25 = /*#__PURE__*/_jsx("span", {
435
404
  className: "ml-auto",
436
405
  children: view.server
437
406
  });
438
- $[59] = view.server;
439
- $[60] = t27;
407
+ $[51] = view.server;
408
+ $[52] = t25;
440
409
  } else {
441
- t27 = $[60];
410
+ t25 = $[52];
442
411
  }
443
- let t28;
444
- if ($[61] !== t23 || $[62] !== t25 || $[63] !== t26 || $[64] !== t27) {
445
- t28 = /*#__PURE__*/_jsxs("div", {
412
+ let t26;
413
+ if ($[53] !== t21 || $[54] !== t23 || $[55] !== t24 || $[56] !== t25) {
414
+ t26 = /*#__PURE__*/_jsxs("div", {
446
415
  className: "flex items-center gap-3 border-t border-border px-2 py-1 text-xs whitespace-nowrap text-text-faint",
447
- children: [t23, t25, t26, t27]
416
+ children: [t21, t23, t24, t25]
448
417
  });
449
- $[61] = t23;
450
- $[62] = t25;
451
- $[63] = t26;
452
- $[64] = t27;
453
- $[65] = t28;
418
+ $[53] = t21;
419
+ $[54] = t23;
420
+ $[55] = t24;
421
+ $[56] = t25;
422
+ $[57] = t26;
454
423
  } else {
455
- t28 = $[65];
424
+ t26 = $[57];
456
425
  }
457
- let t29;
458
- if ($[66] !== t11 || $[67] !== t13 || $[68] !== t21 || $[69] !== t28) {
459
- t29 = /*#__PURE__*/_jsxs("div", {
426
+ let t27;
427
+ if ($[58] !== t11 || $[59] !== t19 || $[60] !== t26 || $[61] !== t9) {
428
+ t27 = /*#__PURE__*/_jsxs("div", {
460
429
  ref: list,
461
430
  className: `${CARD} flex w-max max-w-[min(560px,calc(100vw-16px))] min-w-[340px] flex-col`,
462
- style: t10,
431
+ style: t8,
463
432
  onPointerDown: _temp3,
464
- ...t11,
465
- children: [t13, t21, t28]
433
+ ...t9,
434
+ children: [t11, t19, t26]
466
435
  });
467
- $[66] = t11;
468
- $[67] = t13;
469
- $[68] = t21;
470
- $[69] = t28;
471
- $[70] = t29;
436
+ $[58] = t11;
437
+ $[59] = t19;
438
+ $[60] = t26;
439
+ $[61] = t9;
440
+ $[62] = t27;
472
441
  } else {
473
- t29 = $[70];
442
+ t27 = $[62];
474
443
  }
475
- let t30;
476
- if ($[71] !== view.detailsOpen || $[72] !== view.docs || $[73] !== view.highlightLanguage) {
477
- t30 = view.detailsOpen && view.docs !== null && /*#__PURE__*/_jsxs("div", {
444
+ let t28;
445
+ if ($[63] !== view.detailsOpen || $[64] !== view.docs || $[65] !== view.highlightLanguage) {
446
+ t28 = view.detailsOpen && view.docs !== null && /*#__PURE__*/_jsxs("div", {
478
447
  ref: docs,
479
448
  className: `${CARD} flex w-[360px] flex-col divide-y divide-border overflow-y-auto select-text`,
480
449
  style: {
@@ -491,25 +460,25 @@ export function CompletionPopup(t0) {
491
460
  text: view.docs.text
492
461
  })]
493
462
  });
494
- $[71] = view.detailsOpen;
495
- $[72] = view.docs;
496
- $[73] = view.highlightLanguage;
497
- $[74] = t30;
463
+ $[63] = view.detailsOpen;
464
+ $[64] = view.docs;
465
+ $[65] = view.highlightLanguage;
466
+ $[66] = t28;
498
467
  } else {
499
- t30 = $[74];
468
+ t28 = $[66];
500
469
  }
501
- let t31;
502
- if ($[75] !== t29 || $[76] !== t30) {
503
- t31 = createPortal(/*#__PURE__*/_jsxs(_Fragment, {
504
- children: [t29, t30]
470
+ let t29;
471
+ if ($[67] !== t27 || $[68] !== t28) {
472
+ t29 = createPortal(/*#__PURE__*/_jsxs(_Fragment, {
473
+ children: [t27, t28]
505
474
  }), document.body);
506
- $[75] = t29;
507
- $[76] = t30;
508
- $[77] = t31;
475
+ $[67] = t27;
476
+ $[68] = t28;
477
+ $[69] = t29;
509
478
  } else {
510
- t31 = $[77];
479
+ t29 = $[69];
511
480
  }
512
- return t31;
481
+ return t29;
513
482
  }
514
483
  function _temp4(event_1) {
515
484
  return event_1.preventDefault();
@@ -1,7 +1,7 @@
1
1
  import { type Ref } from 'react';
2
2
  import type { Editor, EditorEngine, EditorTheme } from '@adecore/editor';
3
3
  import { type DiffDocument } from '@adecore/merge';
4
- import type { DiffSourceTokens } from './diff-syntax.ts';
4
+ import { type DiffSourceTokens } from './diff-syntax.ts';
5
5
  import { type DiffLimits } from './diff-expansion.ts';
6
6
  export interface DiffViewProps {
7
7
  engine: EditorEngine;
package/dist/DiffView.js CHANGED
@@ -6,6 +6,7 @@ import { diffDisplay, diffSplit } from '@adecore/merge';
6
6
  import { wordMarks } from './diff-wordmarks.js';
7
7
  import { DiffOverlays } from "./diff-overlays.js";
8
8
  import { SplitDiffView } from "./SplitDiffView.js";
9
+ import { repaintOnTokens } from './diff-syntax.js';
9
10
  import { LineActionHost, RowHost } from './row-host.js';
10
11
  import { DEFAULT_UNFOLD_LIMITS, expandDiff } from './diff-expansion.js';
11
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
@@ -301,35 +302,7 @@ function UnifiedDiffView(t0) {
301
302
  });
302
303
  };
303
304
  refresh();
304
- const ownerWindow = element.current?.ownerDocument.defaultView;
305
- let pending = false;
306
- let stopped = false;
307
- let frame;
308
- const schedule = () => {
309
- if (pending) {
310
- return;
311
- }
312
- pending = true;
313
- const paint = () => {
314
- pending = false;
315
- if (!stopped) {
316
- refresh();
317
- }
318
- };
319
- if (ownerWindow?.requestAnimationFrame !== undefined) {
320
- frame = ownerWindow.requestAnimationFrame(paint);
321
- } else {
322
- queueMicrotask(paint);
323
- }
324
- };
325
- const stop_0 = tokens?.subscribe(schedule);
326
- return () => {
327
- stopped = true;
328
- stop_0?.();
329
- if (frame !== undefined) {
330
- ownerWindow?.cancelAnimationFrame?.(frame);
331
- }
332
- };
305
+ return repaintOnTokens(element.current?.ownerDocument.defaultView, tokens, refresh);
333
306
  };
334
307
  $[40] = engine;
335
308
  $[41] = mounted;