@adecore/editor-react 0.53.3 → 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
@@ -1,5 +1,5 @@
1
- import { type ReactNode } from 'react';
2
1
  import type { EditorRect } from '@adecore/editor';
2
+ import { type ReactNode } from 'react';
3
3
  import { type PlaceOptions } from './popup-placement.ts';
4
4
  export interface AnchoredPopupProps {
5
5
  rect: EditorRect;
@@ -1,4 +1,5 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
+ import { ScrollArea } from '@adecore/ui';
2
3
  import { useLayoutEffect, useRef } from 'react';
3
4
  import { createPortal } from 'react-dom';
4
5
  import { placePopup } from './popup-placement.js';
@@ -8,7 +9,7 @@ import { placePopup } from './popup-placement.js';
8
9
  */
9
10
  import { jsx as _jsx } from "react/jsx-runtime";
10
11
  export function AnchoredPopup(t0) {
11
- const $ = _c(9);
12
+ const $ = _c(13);
12
13
  const {
13
14
  rect,
14
15
  className,
@@ -48,7 +49,8 @@ export function AnchoredPopup(t0) {
48
49
  t2 = $[2];
49
50
  }
50
51
  useLayoutEffect(t2);
51
- const t3 = `fixed top-0 left-0 z-(--z-popup) ${overflow === "clip" ? "overflow-hidden" : "overflow-y-auto"} rounded-lg border border-border bg-surface-raised text-text shadow-(--float-shadow) ${className ?? ""}`;
52
+ const scrolls = overflow === "scroll";
53
+ const t3 = `fixed top-0 left-0 z-(--z-popup) overflow-hidden rounded-lg border border-border bg-surface-raised text-text shadow-(--float-shadow) ${scrolls ? "flex flex-col" : className ?? ""}`;
52
54
  let t4;
53
55
  if ($[3] === Symbol.for("react.memo_cache_sentinel")) {
54
56
  t4 = {
@@ -59,22 +61,35 @@ export function AnchoredPopup(t0) {
59
61
  t4 = $[3];
60
62
  }
61
63
  let t5;
62
- if ($[4] !== children || $[5] !== onPointerEnter || $[6] !== onPointerLeave || $[7] !== t3) {
63
- t5 = createPortal(/*#__PURE__*/_jsx("div", {
64
+ if ($[4] !== children || $[5] !== className || $[6] !== scrolls) {
65
+ t5 = scrolls ? /*#__PURE__*/_jsx(ScrollArea, {
66
+ viewportClassName: className,
67
+ children: children
68
+ }) : children;
69
+ $[4] = children;
70
+ $[5] = className;
71
+ $[6] = scrolls;
72
+ $[7] = t5;
73
+ } else {
74
+ t5 = $[7];
75
+ }
76
+ let t6;
77
+ if ($[8] !== onPointerEnter || $[9] !== onPointerLeave || $[10] !== t3 || $[11] !== t5) {
78
+ t6 = createPortal(/*#__PURE__*/_jsx("div", {
64
79
  ref: element,
65
80
  className: t3,
66
81
  style: t4,
67
82
  onPointerEnter: onPointerEnter,
68
83
  onPointerLeave: onPointerLeave,
69
- children: children
84
+ children: t5
70
85
  }), document.body);
71
- $[4] = children;
72
- $[5] = onPointerEnter;
73
- $[6] = onPointerLeave;
74
- $[7] = t3;
75
- $[8] = t5;
86
+ $[8] = onPointerEnter;
87
+ $[9] = onPointerLeave;
88
+ $[10] = t3;
89
+ $[11] = t5;
90
+ $[12] = t6;
76
91
  } else {
77
- t5 = $[8];
92
+ t6 = $[12];
78
93
  }
79
- return t5;
94
+ return t6;
80
95
  }
@@ -1,5 +1,5 @@
1
- import type { ReactNode } from 'react';
2
1
  import type { EditorMarkColor, EditorRect } from '@adecore/editor';
2
+ import type { ReactNode } from 'react';
3
3
  export interface AttributionCardProps {
4
4
  rect: EditorRect;
5
5
  title: string;
@@ -1,6 +1,6 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
- import { CircleCheck, Sparkles, TriangleAlert } from 'lucide-react';
3
2
  import { Icon } from '@adecore/ui';
3
+ import { CircleCheck, Sparkles, TriangleAlert } from 'lucide-react';
4
4
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
5
  const BASELINE_MARKS = {
6
6
  widely: {
@@ -1,21 +1,21 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
+ import { fileUriToPath } from '@adecore/lsp';
3
+ import { Icon, IconButton, ScrollArea, Segmented, Spinner, Tooltip } from '@adecore/ui';
4
+ import { formatNumber } from '@adecore/ui/format';
5
+ import { ChevronDown, ChevronLeft, ChevronRight, X } from 'lucide-react';
2
6
  import { useEffect, useId, useRef } from 'react';
3
7
  import { createPortal } from 'react-dom';
4
8
  import { useTranslation } from 'react-i18next';
5
- import { ChevronDown, ChevronLeft, ChevronRight, X } from 'lucide-react';
6
- import { fileUriToPath } from '@adecore/lsp';
7
- import { Icon, IconButton, Segmented, Spinner, Tooltip } from '@adecore/ui';
8
- import { formatNumber } from '@adecore/ui/format';
9
+ import { CALL_LEVEL_LIMIT, isTypeDirection } from './call-hierarchy-model.js';
9
10
  import { CALL_HIERARCHY_HEIGHT } from './call-hierarchy.js';
10
- import { PanelResizeHandle } from "./PanelResizeHandle.js";
11
- import { usePanelBody } from './use-panel-body.js';
12
11
  import { PANEL_BODY_HEIGHT } from './panel-size.js';
13
- import { CALL_LEVEL_LIMIT, isTypeDirection } from './call-hierarchy-model.js';
12
+ import { PanelResizeHandle } from "./PanelResizeHandle.js";
14
13
  import { basenameOf, relativeTo } from './paths.js';
15
14
  import { PathText } from "./PathText.js";
16
15
  import { Preview } from "./PeekPanel.js";
17
- import { SymbolBadge } from "./SymbolPicker.js";
18
16
  import { useInputPopup } from './popup-focus.js';
17
+ import { SymbolBadge } from "./SymbolPicker.js";
18
+ import { usePanelBody } from './use-panel-body.js';
19
19
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
20
20
  const INDENT = 14;
21
21
  const BASE_INDENT = 8;
@@ -500,11 +500,12 @@ function Tree(t0) {
500
500
  }
501
501
  let t8;
502
502
  if ($[21] !== t6 || $[22] !== t7 || $[23] !== treeId) {
503
- t8 = /*#__PURE__*/_jsx("div", {
503
+ t8 = /*#__PURE__*/_jsx(ScrollArea, {
504
504
  id: treeId,
505
505
  role: "tree",
506
506
  "aria-label": t6,
507
- className: "w-1/2 shrink-0 overflow-y-auto border-r border-border py-1",
507
+ className: "w-1/2 shrink-0 border-r border-border",
508
+ viewportClassName: "py-1",
508
509
  children: t7
509
510
  });
510
511
  $[21] = t6;
@@ -1,5 +1,5 @@
1
- import { type ReactNode } from 'react';
2
1
  import type { Editor } from '@adecore/editor';
2
+ import { type ReactNode } from 'react';
3
3
  export interface ChangeReviewProps {
4
4
  editor: Editor;
5
5
  selected: string;
@@ -1,8 +1,8 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
- import { useTranslation } from 'react-i18next';
3
- import { GitCommitHorizontal, User, Users } from 'lucide-react';
4
2
  import { Button, Icon, Popover, Separator, Tooltip, useNow } from '@adecore/ui';
5
3
  import { formatAge, formatNumber } from '@adecore/ui/format';
4
+ import { GitCommitHorizontal, User, Users } from 'lucide-react';
5
+ import { useTranslation } from 'react-i18next';
6
6
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
7
7
  const MINUTE_MS = 60_000;
8
8
  /* The newest commit that touched the declaration. Its clock ticks here, so a minute redraws this block and not the card. */
@@ -1,8 +1,8 @@
1
1
  import { c as _c } from "react/compiler-runtime";
2
+ import { formatShortcut, ScrollArea } from '@adecore/ui';
2
3
  import { useId, useLayoutEffect, useRef, useState } from 'react';
3
4
  import { createPortal } from 'react-dom';
4
5
  import { useTranslation } from 'react-i18next';
5
- 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";
@@ -335,10 +335,11 @@ export function CompletionPopup(t0) {
335
335
  }
336
336
  let t19;
337
337
  if ($[35] !== listId || $[36] !== t15 || $[37] !== t16 || $[38] !== t18) {
338
- t19 = /*#__PURE__*/_jsxs("div", {
338
+ t19 = /*#__PURE__*/_jsxs(ScrollArea, {
339
339
  id: listId,
340
340
  role: "listbox",
341
- className: "w-0 min-w-full overflow-y-auto p-1",
341
+ className: "w-0 min-w-full",
342
+ viewportClassName: "p-1",
342
343
  style: t12,
343
344
  onScroll: t13,
344
345
  children: [t15, t16, t18]
@@ -443,22 +444,25 @@ export function CompletionPopup(t0) {
443
444
  }
444
445
  let t28;
445
446
  if ($[63] !== view.detailsOpen || $[64] !== view.docs || $[65] !== view.highlightLanguage) {
446
- t28 = view.detailsOpen && view.docs !== null && /*#__PURE__*/_jsxs("div", {
447
+ t28 = view.detailsOpen && view.docs !== null && /*#__PURE__*/_jsx("div", {
447
448
  ref: docs,
448
- className: `${CARD} flex w-[360px] flex-col divide-y divide-border overflow-y-auto select-text`,
449
+ className: `${CARD} flex w-[360px] flex-col`,
449
450
  style: {
450
451
  visibility: "hidden"
451
452
  },
452
453
  onPointerDown: _temp4,
453
- children: [view.docs.source !== "" && /*#__PURE__*/_jsx("div", {
454
- className: "px-3 py-2",
455
- children: /*#__PURE__*/_jsx(SourceLine, {
456
- text: view.docs.source,
457
- language: view.highlightLanguage
458
- })
459
- }), /*#__PURE__*/_jsx(SymbolSections, {
460
- text: view.docs.text
461
- })]
454
+ children: /*#__PURE__*/_jsxs(ScrollArea, {
455
+ viewportClassName: "flex flex-col divide-y divide-border select-text",
456
+ children: [view.docs.source !== "" && /*#__PURE__*/_jsx("div", {
457
+ className: "px-3 py-2",
458
+ children: /*#__PURE__*/_jsx(SourceLine, {
459
+ text: view.docs.source,
460
+ language: view.highlightLanguage
461
+ })
462
+ }), /*#__PURE__*/_jsx(SymbolSections, {
463
+ text: view.docs.text
464
+ })]
465
+ })
462
466
  });
463
467
  $[63] = view.detailsOpen;
464
468
  $[64] = view.docs;
@@ -1,8 +1,8 @@
1
- import { type Ref } from 'react';
2
1
  import type { Editor, EditorEngine, EditorTheme } from '@adecore/editor';
3
2
  import { type DiffDocument, type DiffSourceLine } from '@adecore/merge';
4
- import { type DiffSourceTokens } from './diff-syntax.ts';
3
+ import { type Ref } from 'react';
5
4
  import { type DiffLimits } from './diff-expansion.ts';
5
+ import { type DiffSourceTokens } from './diff-syntax.ts';
6
6
  export interface DiffViewProps {
7
7
  engine: EditorEngine;
8
8
  document: DiffDocument;