@adecore/editor-react 0.31.11 → 0.32.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 (137) hide show
  1. package/dist/AnchoredPopup.js +73 -19
  2. package/dist/AttributionCard.js +162 -4
  3. package/dist/BaselineStatus.js +62 -8
  4. package/dist/CallHierarchyPanel.js +977 -60
  5. package/dist/ChangeReview.js +76 -25
  6. package/dist/CodeAuthorsCard.js +314 -14
  7. package/dist/CompletionPopup.js +490 -83
  8. package/dist/DiffView.js +548 -181
  9. package/dist/EditorContextMenu.js +352 -34
  10. package/dist/EditorView.js +276 -99
  11. package/dist/FindReplace.js +525 -67
  12. package/dist/HoverCard.js +378 -38
  13. package/dist/HoverSections.js +367 -56
  14. package/dist/LanguagePopups.js +95 -34
  15. package/dist/Markdown.js +41 -6
  16. package/dist/PanelResizeHandle.js +199 -66
  17. package/dist/PathText.js +49 -7
  18. package/dist/PeekPanel.js +675 -72
  19. package/dist/PickPopup.js +304 -34
  20. package/dist/RenameCard.js +679 -85
  21. package/dist/RenderedDocs.js +329 -58
  22. package/dist/SignatureCard.js +91 -7
  23. package/dist/SplitDiffView.js +344 -254
  24. package/dist/SymbolPicker.js +440 -85
  25. package/dist/call-hierarchy-model.js +102 -68
  26. package/dist/call-hierarchy.js +458 -359
  27. package/dist/code-actions-model.js +88 -76
  28. package/dist/code-actions.js +372 -283
  29. package/dist/code-authors.js +64 -55
  30. package/dist/code-vision-model.js +134 -127
  31. package/dist/code-vision.js +224 -206
  32. package/dist/completion-call.js +94 -67
  33. package/dist/completion-model.js +334 -244
  34. package/dist/completion.js +840 -649
  35. package/dist/conflict-model.js +35 -29
  36. package/dist/context-menu-rows.js +42 -17
  37. package/dist/context-menu.js +64 -46
  38. package/dist/definition-link.js +88 -85
  39. package/dist/diagnostics-model.js +74 -55
  40. package/dist/diagnostics.js +121 -100
  41. package/dist/diff-expansion.js +38 -35
  42. package/dist/diff-overlays.js +144 -22
  43. package/dist/diff-syntax.js +65 -42
  44. package/dist/diff-wordmarks.js +26 -23
  45. package/dist/doc-comment-model.js +265 -216
  46. package/dist/editor-language.js +177 -152
  47. package/dist/error-message.js +2 -2
  48. package/dist/find-query.js +49 -36
  49. package/dist/folding.js +81 -62
  50. package/dist/format-on-type.js +86 -67
  51. package/dist/highlight-layers.js +19 -20
  52. package/dist/highlights.js +105 -83
  53. package/dist/history.js +44 -38
  54. package/dist/holder.js +18 -18
  55. package/dist/host-types.js +1 -1
  56. package/dist/hover-content.js +167 -129
  57. package/dist/hover.js +285 -245
  58. package/dist/index.js +10 -10
  59. package/dist/inlay-hints.js +369 -324
  60. package/dist/key-priority.js +34 -31
  61. package/dist/language-ids.js +45 -42
  62. package/dist/line-edits.js +74 -28
  63. package/dist/line-text.js +18 -3
  64. package/dist/locales/en.json +38 -38
  65. package/dist/locales/nl.json +41 -41
  66. package/dist/models.js +1 -1
  67. package/dist/navigation-history.js +40 -41
  68. package/dist/navigation.js +141 -123
  69. package/dist/panel-size.js +8 -8
  70. package/dist/patch-decorations.js +236 -160
  71. package/dist/patch-layout.js +331 -262
  72. package/dist/paths.js +3 -3
  73. package/dist/peek-model.js +86 -69
  74. package/dist/peek.js +254 -192
  75. package/dist/pick.js +164 -157
  76. package/dist/popup-focus.js +5 -5
  77. package/dist/popup-placement.js +36 -21
  78. package/dist/popups.js +13 -13
  79. package/dist/project-language.js +228 -211
  80. package/dist/project-problems.js +81 -69
  81. package/dist/proposal-model.js +163 -126
  82. package/dist/recent-choices.js +25 -25
  83. package/dist/refresher.js +44 -49
  84. package/dist/rename-model.js +113 -113
  85. package/dist/rename.js +321 -233
  86. package/dist/rendered-docs.d.ts +4 -2
  87. package/dist/rendered-docs.js +384 -318
  88. package/dist/rendering-context.js +5 -3
  89. package/dist/rendering.js +22 -4
  90. package/dist/review-group.js +42 -39
  91. package/dist/row-host.d.ts +4 -2
  92. package/dist/row-host.js +90 -78
  93. package/dist/selection-ranges.js +21 -17
  94. package/dist/semantic-delta.js +22 -19
  95. package/dist/semantic-model.js +86 -73
  96. package/dist/semantic-tokens.js +201 -162
  97. package/dist/shortcut-keys.js +16 -10
  98. package/dist/signature-model.js +34 -28
  99. package/dist/signature.js +177 -129
  100. package/dist/snippet-field-transforms.js +118 -106
  101. package/dist/snippet-indent.js +48 -43
  102. package/dist/snippet-range-order.js +11 -11
  103. package/dist/snippet-session.js +703 -667
  104. package/dist/snippet-transform-client.js +59 -59
  105. package/dist/snippet-transform-format.js +285 -263
  106. package/dist/snippet-transform-protocol.js +1 -1
  107. package/dist/snippet-transform-queue.js +163 -153
  108. package/dist/snippet-transform-worker.js +42 -35
  109. package/dist/snippet-variable-names.js +1 -36
  110. package/dist/snippet-variables.js +53 -63
  111. package/dist/snippet.js +477 -405
  112. package/dist/split-alignment.js +47 -35
  113. package/dist/split-scroll.js +42 -40
  114. package/dist/symbol-links.js +33 -25
  115. package/dist/symbol-picker-model.js +126 -116
  116. package/dist/symbol-picker.js +98 -59
  117. package/dist/symbols.js +117 -88
  118. package/dist/testing.js +248 -165
  119. package/dist/timers.js +35 -30
  120. package/dist/use-panel-body.js +49 -8
  121. package/dist/use-problem-counts.js +29 -15
  122. package/dist/view-state.js +54 -33
  123. package/dist/word-diff.js +18 -18
  124. package/dist/workspace-edit.js +300 -249
  125. package/package.json +6 -6
  126. package/src/CallHierarchyPanel.tsx +2 -2
  127. package/src/DiffView.tsx +3 -3
  128. package/src/FindReplace.tsx +2 -2
  129. package/src/LanguagePopups.tsx +2 -0
  130. package/src/PeekPanel.tsx +3 -3
  131. package/src/RenderedDocs.tsx +9 -10
  132. package/src/SymbolPicker.tsx +2 -2
  133. package/src/diff-overlays.tsx +6 -4
  134. package/src/locales/en.json +38 -38
  135. package/src/locales/nl.json +41 -41
  136. package/src/rendered-docs.ts +14 -3
  137. package/src/row-host.ts +14 -3
@@ -1,5 +1,5 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useEffect, useMemo, useRef, useState } from 'react';
1
+ import { c as _c } from "react/compiler-runtime";
2
+ import { useEffect, useRef, useState } from 'react';
3
3
  import { createPortal } from 'react-dom';
4
4
  import { useTranslation } from 'react-i18next';
5
5
  import { AtSign, Hash } from 'lucide-react';
@@ -8,101 +8,456 @@ import { formatShortcut, Icon } from '@adecore/ui';
8
8
  import { formatNumber } from '@adecore/ui/format';
9
9
  import { basenameOf } from './paths.js';
10
10
  import { filterEntries, groupEntries, letterOfKind, modeOf, toneOfKind } from './symbol-picker-model.js';
11
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
12
  const TONES = {
12
- callable: 'bg-accent-soft text-accent',
13
- value: 'bg-status-running/15 text-status-running',
14
- type: 'bg-status-idle/15 text-status-idle',
15
- other: 'bg-surface-hover text-text-muted'
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'
16
17
  };
17
18
  const SEARCH_DELAY_MS = 200;
18
19
  /* The letter badge of a symbol kind, tinted by what the symbol is. */
19
- export function SymbolBadge({ kind }) {
20
- return (_jsx("span", { className: `grid size-4 shrink-0 place-items-center rounded-sm font-mono text-xs font-semibold ${TONES[toneOfKind(kind)]}`, children: letterOfKind(kind) }));
20
+ export function SymbolBadge(t0) {
21
+ const $ = _c(5);
22
+ const {
23
+ kind
24
+ } = t0;
25
+ const t1 = `grid size-4 shrink-0 place-items-center rounded-sm font-mono text-xs font-semibold ${TONES[toneOfKind(kind)]}`;
26
+ let t2;
27
+ if ($[0] !== kind) {
28
+ t2 = letterOfKind(kind);
29
+ $[0] = kind;
30
+ $[1] = t2;
31
+ } else {
32
+ t2 = $[1];
33
+ }
34
+ let t3;
35
+ if ($[2] !== t1 || $[3] !== t2) {
36
+ t3 = /*#__PURE__*/_jsx("span", {
37
+ className: t1,
38
+ children: t2
39
+ });
40
+ $[2] = t1;
41
+ $[3] = t2;
42
+ $[4] = t3;
43
+ } else {
44
+ t3 = $[4];
45
+ }
46
+ return t3;
21
47
  }
22
48
  /*
23
49
  * The picker of go to symbol, over the editor: an input, the symbols of the file in groups by kind, and the
24
50
  * keys. The input keeps the focus; Enter goes, Escape and the focus leaving close it.
25
51
  */
26
- export function SymbolPicker({ language, view }) {
27
- const { t } = useTranslation('editor');
28
- const [input, setInput] = useState('');
29
- const [active, setActive] = useState(0);
30
- const [found, setFound] = useState({ text: '', entries: [] });
31
- const activeRow = useRef(null);
32
- const mode = modeOf(input);
33
- const filterText = mode.mode === 'symbol' ? mode.text : '';
34
- const searchText = mode.mode === 'workspace' ? mode.text : '';
35
- const groups = useMemo(() => groupEntries(filterEntries(view.entries, filterText)), [view.entries, filterText]);
36
- const flat = groups.flatMap((group) => group.entries);
37
- const places = mode.mode === 'workspace' && found.text === mode.text ? found.entries : [];
38
- const count = mode.mode === 'workspace' ? places.length : mode.mode === 'line' ? (mode.line === null ? 0 : 1) : flat.length;
39
- useEffect(() => {
40
- if (searchText === '') {
41
- return;
42
- }
43
- const controller = new AbortController();
44
- const text = searchText;
45
- const timer = setTimeout(() => {
46
- language.symbolPicker
47
- .search(text, controller.signal)
48
- .then((entries) => !controller.signal.aborted && setFound({ text, entries }))
49
- .catch(() => undefined);
50
- }, SEARCH_DELAY_MS);
51
- return () => {
52
- clearTimeout(timer);
53
- controller.abort();
54
- };
55
- }, [language, searchText]);
56
- useEffect(() => {
57
- activeRow.current?.scrollIntoView({ block: 'nearest' });
58
- }, [active, input]);
59
- function choose(index) {
60
- if (mode.mode === 'line') {
61
- if (mode.line !== null) {
62
- language.symbolPicker.goToLine(mode.line);
63
- }
64
- }
65
- else if (mode.mode === 'workspace') {
66
- const place = places[index];
67
- if (place !== undefined) {
68
- language.symbolPicker.goToWorkspace(place);
69
- }
70
- }
71
- else if (flat[index] !== undefined) {
72
- language.symbolPicker.goTo(flat[index]);
73
- }
52
+ export function SymbolPicker(t0) {
53
+ const $ = _c(56);
54
+ const {
55
+ language,
56
+ view
57
+ } = t0;
58
+ const {
59
+ t
60
+ } = useTranslation("editor");
61
+ const [input, setInput] = useState("");
62
+ const [active, setActive] = useState(0);
63
+ let t1;
64
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
65
+ t1 = {
66
+ text: "",
67
+ entries: []
68
+ };
69
+ $[0] = t1;
70
+ } else {
71
+ t1 = $[0];
72
+ }
73
+ const [found, setFound] = useState(t1);
74
+ const activeRow = useRef(null);
75
+ const mode = modeOf(input);
76
+ const filterText = mode.mode === "symbol" ? mode.text : "";
77
+ const searchText = mode.mode === "workspace" ? mode.text : "";
78
+ const groups = groupEntries(filterEntries(view.entries, filterText));
79
+ const flat = groups.flatMap(_temp);
80
+ const places = mode.mode === "workspace" && found.text === mode.text ? found.entries : [];
81
+ const count = mode.mode === "workspace" ? places.length : mode.mode === "line" ? mode.line === null ? 0 : 1 : flat.length;
82
+ useEffect(() => {
83
+ if (searchText === "") {
84
+ return;
74
85
  }
75
- function onKeyDown(event) {
76
- if (event.key === 'Escape') {
77
- event.preventDefault();
78
- event.stopPropagation();
79
- language.symbolPicker.close();
86
+ const controller = new AbortController();
87
+ const text = searchText;
88
+ const timer = setTimeout(() => {
89
+ language.symbolPicker.search(text, controller.signal).then(entries => !controller.signal.aborted && setFound({
90
+ text,
91
+ entries
92
+ })).catch(_temp2);
93
+ }, SEARCH_DELAY_MS);
94
+ return () => {
95
+ clearTimeout(timer);
96
+ controller.abort();
97
+ };
98
+ }, [language, searchText]);
99
+ let t2;
100
+ if ($[1] === Symbol.for("react.memo_cache_sentinel")) {
101
+ t2 = () => {
102
+ activeRow.current?.scrollIntoView({
103
+ block: "nearest"
104
+ });
105
+ };
106
+ $[1] = t2;
107
+ } else {
108
+ t2 = $[1];
109
+ }
110
+ let t3;
111
+ if ($[2] !== active || $[3] !== input) {
112
+ t3 = [active, input];
113
+ $[2] = active;
114
+ $[3] = input;
115
+ $[4] = t3;
116
+ } else {
117
+ t3 = $[4];
118
+ }
119
+ useEffect(t2, t3);
120
+ const choose = function choose(index) {
121
+ if (mode.mode === "line") {
122
+ if (mode.line !== null) {
123
+ language.symbolPicker.goToLine(mode.line);
124
+ }
125
+ } else {
126
+ if (mode.mode === "workspace") {
127
+ const place = places[index];
128
+ if (place !== undefined) {
129
+ language.symbolPicker.goToWorkspace(place);
80
130
  }
81
- else if (event.key === 'Enter' && !event.nativeEvent.isComposing) {
82
- event.preventDefault();
83
- event.stopPropagation();
84
- choose(active);
131
+ } else {
132
+ if (flat[index] !== undefined) {
133
+ language.symbolPicker.goTo(flat[index]);
85
134
  }
86
- else if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {
87
- event.preventDefault();
88
- setActive(Math.max(0, Math.min(Math.max(0, count - 1), active + (event.key === 'ArrowDown' ? 1 : -1))));
135
+ }
136
+ }
137
+ };
138
+ const onKeyDown = function onKeyDown(event) {
139
+ if (event.key === "Escape") {
140
+ event.preventDefault();
141
+ event.stopPropagation();
142
+ language.symbolPicker.close();
143
+ } else {
144
+ if (event.key === "Enter" && !event.nativeEvent.isComposing) {
145
+ event.preventDefault();
146
+ event.stopPropagation();
147
+ choose(active);
148
+ } else {
149
+ if (event.key === "ArrowDown" || event.key === "ArrowUp") {
150
+ event.preventDefault();
151
+ setActive(Math.max(0, Math.min(Math.max(0, count - 1), active + (event.key === "ArrowDown" ? 1 : -1))));
89
152
  }
153
+ }
90
154
  }
91
- let offset = 0;
92
- return createPortal(_jsxs("div", { className: "fixed top-[12vh] left-1/2 z-(--z-popup) flex w-[560px] max-w-[calc(100vw-16px)] -translate-x-1/2 flex-col overflow-hidden rounded-lg border border-border bg-surface-raised text-text shadow-(--float-shadow)", onPointerDown: (event) => event.target !== event.currentTarget && event.target.tagName !== 'INPUT' && event.preventDefault(), children: [_jsxs("div", { className: "flex items-center gap-2 border-b border-border px-3 py-2", children: [_jsx(Icon, { icon: mode.mode === 'workspace' ? Hash : AtSign, size: 14, className: "shrink-0 text-text-muted" }), _jsx("input", { autoFocus: true, value: input, spellCheck: false, autoComplete: "off", placeholder: t('language.symbols.placeholder', { file: view.file }), className: "min-w-0 flex-1 bg-transparent text-sm text-text outline-none placeholder:text-text-faint", onChange: (event) => {
93
- setInput(event.target.value);
94
- setActive(0);
95
- }, onKeyDown: onKeyDown, onBlur: () => language.symbolPicker.close() }), _jsx("span", { className: "shrink-0 text-xs text-text-faint", children: language.shortcuts.goToSymbol === null ? '' : formatShortcut(language.shortcuts.goToSymbol, language.apple) })] }), _jsxs("div", { role: "listbox", className: "max-h-[320px] overflow-y-auto p-1", children: [mode.mode === 'line' && (_jsx("div", { className: "px-2 py-1.5 text-xs text-text-muted", children: mode.line === null ? t('language.symbols.lineHint') : t('language.symbols.goToLine', { line: formatNumber(mode.line) }) })), mode.mode === 'workspace' &&
96
- places.map((place, index) => {
97
- const path = fileUriToPath(place.uri);
98
- return (_jsxs("button", { ref: index === active ? activeRow : undefined, type: "button", role: "option", "aria-selected": index === active, "data-active": index === active, className: "flex h-7 w-full items-center gap-2 rounded-md px-2 text-left text-xs cursor-row", onClick: () => choose(index), children: [_jsx(SymbolBadge, { kind: place.kind }), _jsx("span", { className: "shrink-0", children: place.name }), _jsx("span", { className: "min-w-0 truncate font-mono text-text-faint", children: place.container }), _jsxs("span", { className: "ml-auto shrink-0 font-mono text-text-faint", children: [path === null ? '' : basenameOf(path), ":", formatNumber(place.line + 1)] })] }, place.id));
99
- }), mode.mode === 'symbol' &&
100
- groups.map((group) => {
101
- const start = offset;
102
- offset += group.entries.length;
103
- return (_jsxs("div", { role: "group", children: [_jsx("div", { className: "px-2 pt-1.5 pb-0.5 text-xs font-medium text-text-faint", children: t(`language.symbols.groups.${group.group}`) }), group.entries.map((entry, index) => {
104
- const position = start + index;
105
- return (_jsxs("button", { ref: position === active ? activeRow : undefined, type: "button", role: "option", "aria-selected": position === active, "data-active": position === active, className: "flex h-7 w-full items-center gap-2 rounded-md px-2 text-left text-xs cursor-row", onClick: () => choose(position), children: [_jsx(SymbolBadge, { kind: entry.kind }), _jsx("span", { className: "shrink-0", children: entry.name }), _jsx("span", { className: "min-w-0 truncate font-mono text-text-faint", children: entry.detail }), entry.container !== '' && _jsx("span", { className: "min-w-0 truncate text-text-faint", children: entry.container }), _jsx("span", { className: "ml-auto shrink-0 font-mono text-text-faint", children: formatNumber(entry.line + 1) })] }, entry.id));
106
- })] }, group.group));
107
- }), mode.mode === 'symbol' && flat.length === 0 && (_jsx("div", { className: "px-2 py-3 text-center text-xs text-text-muted", children: t('language.symbols.none') })), mode.mode === 'workspace' && places.length === 0 && (_jsx("div", { className: "px-2 py-3 text-center text-xs text-text-muted", children: mode.text === '' ? t('language.symbols.workspaceHint') : t('language.symbols.none') }))] }), _jsxs("div", { className: "flex items-center gap-3 border-t border-border px-3 py-1.5 text-xs whitespace-nowrap text-text-faint", children: [_jsxs("span", { children: ["\u2191\u2193 ", t('language.symbols.navigate')] }), _jsxs("span", { children: ["\u21B5 ", t('language.symbols.open')] }), _jsxs("button", { type: "button", className: "ml-auto hover:text-text", onClick: () => setInput('#'), children: ["# ", t('language.symbols.workspace')] }), _jsxs("button", { type: "button", className: "hover:text-text", onClick: () => setInput(':'), children: [": ", t('language.symbols.line')] })] })] }), document.body);
155
+ };
156
+ let offset = 0;
157
+ const t4 = mode.mode === "workspace" ? Hash : AtSign;
158
+ let t5;
159
+ if ($[5] !== t4) {
160
+ t5 = /*#__PURE__*/_jsx(Icon, {
161
+ icon: t4,
162
+ size: 14,
163
+ className: "shrink-0 text-text-muted"
164
+ });
165
+ $[5] = t4;
166
+ $[6] = t5;
167
+ } else {
168
+ t5 = $[6];
169
+ }
170
+ let t6;
171
+ if ($[7] !== t || $[8] !== view.file) {
172
+ t6 = t("language.symbols.placeholder", {
173
+ file: view.file
174
+ });
175
+ $[7] = t;
176
+ $[8] = view.file;
177
+ $[9] = t6;
178
+ } else {
179
+ t6 = $[9];
180
+ }
181
+ let t7;
182
+ if ($[10] === Symbol.for("react.memo_cache_sentinel")) {
183
+ t7 = event_1 => {
184
+ setInput(event_1.target.value);
185
+ setActive(0);
186
+ };
187
+ $[10] = t7;
188
+ } else {
189
+ t7 = $[10];
190
+ }
191
+ let t8;
192
+ if ($[11] !== language.symbolPicker) {
193
+ t8 = () => language.symbolPicker.close();
194
+ $[11] = language.symbolPicker;
195
+ $[12] = t8;
196
+ } else {
197
+ t8 = $[12];
198
+ }
199
+ let t9;
200
+ if ($[13] !== language.apple || $[14] !== language.shortcuts.goToSymbol) {
201
+ t9 = language.shortcuts.goToSymbol === null ? "" : formatShortcut(language.shortcuts.goToSymbol, language.apple);
202
+ $[13] = language.apple;
203
+ $[14] = language.shortcuts.goToSymbol;
204
+ $[15] = t9;
205
+ } else {
206
+ t9 = $[15];
207
+ }
208
+ let t10;
209
+ if ($[16] !== t9) {
210
+ t10 = /*#__PURE__*/_jsx("span", {
211
+ className: "shrink-0 text-xs text-text-faint",
212
+ children: t9
213
+ });
214
+ $[16] = t9;
215
+ $[17] = t10;
216
+ } else {
217
+ t10 = $[17];
218
+ }
219
+ const t11 = "listbox";
220
+ const t12 = "max-h-[320px] overflow-y-auto p-1";
221
+ const t13 = mode.mode === "line" && /*#__PURE__*/_jsx("div", {
222
+ className: "px-2 py-1.5 text-xs text-text-muted",
223
+ children: mode.line === null ? t("language.symbols.lineHint") : t("language.symbols.goToLine", {
224
+ line: formatNumber(mode.line)
225
+ })
226
+ });
227
+ const t14 = mode.mode === "workspace" && places.map((place_0, index_0) => {
228
+ const path = fileUriToPath(place_0.uri);
229
+ return /*#__PURE__*/_jsxs("button", {
230
+ ref: index_0 === active ? activeRow : undefined,
231
+ type: "button",
232
+ role: "option",
233
+ "aria-selected": index_0 === active,
234
+ "data-active": index_0 === active,
235
+ className: "flex h-7 w-full items-center gap-2 rounded-md px-2 text-left text-xs cursor-row",
236
+ onClick: () => choose(index_0),
237
+ children: [/*#__PURE__*/_jsx(SymbolBadge, {
238
+ kind: place_0.kind
239
+ }), /*#__PURE__*/_jsx("span", {
240
+ className: "shrink-0",
241
+ children: place_0.name
242
+ }), /*#__PURE__*/_jsx("span", {
243
+ className: "min-w-0 truncate font-mono text-text-faint",
244
+ children: place_0.container
245
+ }), /*#__PURE__*/_jsxs("span", {
246
+ className: "ml-auto shrink-0 font-mono text-text-faint",
247
+ children: [path === null ? "" : basenameOf(path), ":", formatNumber(place_0.line + 1)]
248
+ })]
249
+ }, place_0.id);
250
+ });
251
+ const t15 = mode.mode === "symbol" && groups.map(group_0 => {
252
+ const start = offset;
253
+ offset = offset + group_0.entries.length;
254
+ offset;
255
+ return /*#__PURE__*/_jsxs("div", {
256
+ role: "group",
257
+ children: [/*#__PURE__*/_jsx("div", {
258
+ className: "px-2 pt-1.5 pb-0.5 text-xs font-medium text-text-faint",
259
+ children: t(`language.symbols.groups.${group_0.group}`)
260
+ }), group_0.entries.map((entry, index_1) => {
261
+ const position = start + index_1;
262
+ return /*#__PURE__*/_jsxs("button", {
263
+ ref: position === active ? activeRow : undefined,
264
+ type: "button",
265
+ role: "option",
266
+ "aria-selected": position === active,
267
+ "data-active": position === active,
268
+ className: "flex h-7 w-full items-center gap-2 rounded-md px-2 text-left text-xs cursor-row",
269
+ onClick: () => choose(position),
270
+ children: [/*#__PURE__*/_jsx(SymbolBadge, {
271
+ kind: entry.kind
272
+ }), /*#__PURE__*/_jsx("span", {
273
+ className: "shrink-0",
274
+ children: entry.name
275
+ }), /*#__PURE__*/_jsx("span", {
276
+ className: "min-w-0 truncate font-mono text-text-faint",
277
+ children: entry.detail
278
+ }), entry.container !== "" && /*#__PURE__*/_jsx("span", {
279
+ className: "min-w-0 truncate text-text-faint",
280
+ children: entry.container
281
+ }), /*#__PURE__*/_jsx("span", {
282
+ className: "ml-auto shrink-0 font-mono text-text-faint",
283
+ children: formatNumber(entry.line + 1)
284
+ })]
285
+ }, entry.id);
286
+ })]
287
+ }, group_0.group);
288
+ });
289
+ let t16;
290
+ if ($[18] !== flat || $[19] !== mode.mode || $[20] !== t) {
291
+ t16 = mode.mode === "symbol" && flat.length === 0 && /*#__PURE__*/_jsx("div", {
292
+ className: "px-2 py-3 text-center text-xs text-text-muted",
293
+ children: t("language.symbols.none")
294
+ });
295
+ $[18] = flat;
296
+ $[19] = mode.mode;
297
+ $[20] = t;
298
+ $[21] = t16;
299
+ } else {
300
+ t16 = $[21];
301
+ }
302
+ let t17;
303
+ if ($[22] !== mode.mode || $[23] !== mode.text || $[24] !== places || $[25] !== t) {
304
+ t17 = mode.mode === "workspace" && places.length === 0 && /*#__PURE__*/_jsx("div", {
305
+ className: "px-2 py-3 text-center text-xs text-text-muted",
306
+ children: mode.text === "" ? t("language.symbols.workspaceHint") : t("language.symbols.none")
307
+ });
308
+ $[22] = mode.mode;
309
+ $[23] = mode.text;
310
+ $[24] = places;
311
+ $[25] = t;
312
+ $[26] = t17;
313
+ } else {
314
+ t17 = $[26];
315
+ }
316
+ let t18;
317
+ if ($[27] !== t13 || $[28] !== t14 || $[29] !== t15 || $[30] !== t16 || $[31] !== t17) {
318
+ t18 = /*#__PURE__*/_jsxs("div", {
319
+ role: t11,
320
+ className: t12,
321
+ children: [t13, t14, t15, t16, t17]
322
+ });
323
+ $[27] = t13;
324
+ $[28] = t14;
325
+ $[29] = t15;
326
+ $[30] = t16;
327
+ $[31] = t17;
328
+ $[32] = t18;
329
+ } else {
330
+ t18 = $[32];
331
+ }
332
+ let t19;
333
+ if ($[33] !== t) {
334
+ t19 = t("language.symbols.navigate");
335
+ $[33] = t;
336
+ $[34] = t19;
337
+ } else {
338
+ t19 = $[34];
339
+ }
340
+ let t20;
341
+ if ($[35] !== t19) {
342
+ t20 = /*#__PURE__*/_jsxs("span", {
343
+ children: ["\u2191\u2193 ", t19]
344
+ });
345
+ $[35] = t19;
346
+ $[36] = t20;
347
+ } else {
348
+ t20 = $[36];
349
+ }
350
+ let t21;
351
+ if ($[37] !== t) {
352
+ t21 = t("language.symbols.open");
353
+ $[37] = t;
354
+ $[38] = t21;
355
+ } else {
356
+ t21 = $[38];
357
+ }
358
+ let t22;
359
+ if ($[39] !== t21) {
360
+ t22 = /*#__PURE__*/_jsxs("span", {
361
+ children: ["\u21B5 ", t21]
362
+ });
363
+ $[39] = t21;
364
+ $[40] = t22;
365
+ } else {
366
+ t22 = $[40];
367
+ }
368
+ let t23;
369
+ if ($[41] === Symbol.for("react.memo_cache_sentinel")) {
370
+ t23 = () => setInput("#");
371
+ $[41] = t23;
372
+ } else {
373
+ t23 = $[41];
374
+ }
375
+ let t24;
376
+ if ($[42] !== t) {
377
+ t24 = t("language.symbols.workspace");
378
+ $[42] = t;
379
+ $[43] = t24;
380
+ } else {
381
+ t24 = $[43];
382
+ }
383
+ let t25;
384
+ if ($[44] !== t24) {
385
+ t25 = /*#__PURE__*/_jsxs("button", {
386
+ type: "button",
387
+ className: "ml-auto hover:text-text",
388
+ onClick: t23,
389
+ children: ["# ", t24]
390
+ });
391
+ $[44] = t24;
392
+ $[45] = t25;
393
+ } else {
394
+ t25 = $[45];
395
+ }
396
+ let t26;
397
+ if ($[46] === Symbol.for("react.memo_cache_sentinel")) {
398
+ t26 = () => setInput(":");
399
+ $[46] = t26;
400
+ } else {
401
+ t26 = $[46];
402
+ }
403
+ let t27;
404
+ if ($[47] !== t) {
405
+ t27 = t("language.symbols.line");
406
+ $[47] = t;
407
+ $[48] = t27;
408
+ } else {
409
+ t27 = $[48];
410
+ }
411
+ let t28;
412
+ if ($[49] !== t27) {
413
+ t28 = /*#__PURE__*/_jsxs("button", {
414
+ type: "button",
415
+ className: "hover:text-text",
416
+ onClick: t26,
417
+ children: [": ", t27]
418
+ });
419
+ $[49] = t27;
420
+ $[50] = t28;
421
+ } else {
422
+ t28 = $[50];
423
+ }
424
+ let t29;
425
+ if ($[51] !== t20 || $[52] !== t22 || $[53] !== t25 || $[54] !== t28) {
426
+ t29 = /*#__PURE__*/_jsxs("div", {
427
+ className: "flex items-center gap-3 border-t border-border px-3 py-1.5 text-xs whitespace-nowrap text-text-faint",
428
+ children: [t20, t22, t25, t28]
429
+ });
430
+ $[51] = t20;
431
+ $[52] = t22;
432
+ $[53] = t25;
433
+ $[54] = t28;
434
+ $[55] = t29;
435
+ } else {
436
+ t29 = $[55];
437
+ }
438
+ return createPortal(/*#__PURE__*/_jsxs("div", {
439
+ className: "fixed top-[12vh] left-1/2 z-(--z-popup) flex w-[560px] max-w-[calc(100vw-16px)] -translate-x-1/2 flex-col overflow-hidden rounded-lg border border-border bg-surface-raised text-text shadow-(--float-shadow)",
440
+ onPointerDown: _temp3,
441
+ children: [/*#__PURE__*/_jsxs("div", {
442
+ className: "flex items-center gap-2 border-b border-border px-3 py-2",
443
+ children: [t5, /*#__PURE__*/_jsx("input", {
444
+ autoFocus: true,
445
+ value: input,
446
+ spellCheck: false,
447
+ autoComplete: "off",
448
+ placeholder: t6,
449
+ className: "min-w-0 flex-1 bg-transparent text-sm text-text outline-none placeholder:text-text-faint",
450
+ onChange: t7,
451
+ onKeyDown: onKeyDown,
452
+ onBlur: t8
453
+ }), t10]
454
+ }), t18, t29]
455
+ }), document.body);
456
+ }
457
+ function _temp3(event_0) {
458
+ return event_0.target !== event_0.currentTarget && event_0.target.tagName !== "INPUT" && event_0.preventDefault();
108
459
  }
460
+ function _temp2() {}
461
+ function _temp(group) {
462
+ return group.entries;
463
+ }