@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.
- package/dist/AnchoredPopup.js +73 -19
- package/dist/AttributionCard.js +162 -4
- package/dist/BaselineStatus.js +62 -8
- package/dist/CallHierarchyPanel.js +977 -60
- package/dist/ChangeReview.js +76 -25
- package/dist/CodeAuthorsCard.js +314 -14
- package/dist/CompletionPopup.js +490 -83
- package/dist/DiffView.js +548 -181
- package/dist/EditorContextMenu.js +352 -34
- package/dist/EditorView.js +276 -99
- package/dist/FindReplace.js +525 -67
- package/dist/HoverCard.js +378 -38
- package/dist/HoverSections.js +367 -56
- package/dist/LanguagePopups.js +95 -34
- package/dist/Markdown.js +41 -6
- package/dist/PanelResizeHandle.js +199 -66
- package/dist/PathText.js +49 -7
- package/dist/PeekPanel.js +675 -72
- package/dist/PickPopup.js +304 -34
- package/dist/RenameCard.js +679 -85
- package/dist/RenderedDocs.js +329 -58
- package/dist/SignatureCard.js +91 -7
- package/dist/SplitDiffView.js +344 -254
- package/dist/SymbolPicker.js +440 -85
- package/dist/call-hierarchy-model.js +102 -68
- package/dist/call-hierarchy.js +458 -359
- package/dist/code-actions-model.js +88 -76
- package/dist/code-actions.js +372 -283
- package/dist/code-authors.js +64 -55
- package/dist/code-vision-model.js +134 -127
- package/dist/code-vision.js +224 -206
- package/dist/completion-call.js +94 -67
- package/dist/completion-model.js +334 -244
- package/dist/completion.js +840 -649
- package/dist/conflict-model.js +35 -29
- package/dist/context-menu-rows.js +42 -17
- package/dist/context-menu.js +64 -46
- package/dist/definition-link.js +88 -85
- package/dist/diagnostics-model.js +74 -55
- package/dist/diagnostics.js +121 -100
- package/dist/diff-expansion.js +38 -35
- package/dist/diff-overlays.js +144 -22
- package/dist/diff-syntax.js +65 -42
- package/dist/diff-wordmarks.js +26 -23
- package/dist/doc-comment-model.js +265 -216
- package/dist/editor-language.js +177 -152
- package/dist/error-message.js +2 -2
- package/dist/find-query.js +49 -36
- package/dist/folding.js +81 -62
- package/dist/format-on-type.js +86 -67
- package/dist/highlight-layers.js +19 -20
- package/dist/highlights.js +105 -83
- package/dist/history.js +44 -38
- package/dist/holder.js +18 -18
- package/dist/host-types.js +1 -1
- package/dist/hover-content.js +167 -129
- package/dist/hover.js +285 -245
- package/dist/index.js +10 -10
- package/dist/inlay-hints.js +369 -324
- package/dist/key-priority.js +34 -31
- package/dist/language-ids.js +45 -42
- package/dist/line-edits.js +74 -28
- package/dist/line-text.js +18 -3
- package/dist/locales/en.json +38 -38
- package/dist/locales/nl.json +41 -41
- package/dist/models.js +1 -1
- package/dist/navigation-history.js +40 -41
- package/dist/navigation.js +141 -123
- package/dist/panel-size.js +8 -8
- package/dist/patch-decorations.js +236 -160
- package/dist/patch-layout.js +331 -262
- package/dist/paths.js +3 -3
- package/dist/peek-model.js +86 -69
- package/dist/peek.js +254 -192
- package/dist/pick.js +164 -157
- package/dist/popup-focus.js +5 -5
- package/dist/popup-placement.js +36 -21
- package/dist/popups.js +13 -13
- package/dist/project-language.js +228 -211
- package/dist/project-problems.js +81 -69
- package/dist/proposal-model.js +163 -126
- package/dist/recent-choices.js +25 -25
- package/dist/refresher.js +44 -49
- package/dist/rename-model.js +113 -113
- package/dist/rename.js +321 -233
- package/dist/rendered-docs.d.ts +4 -2
- package/dist/rendered-docs.js +384 -318
- package/dist/rendering-context.js +5 -3
- package/dist/rendering.js +22 -4
- package/dist/review-group.js +42 -39
- package/dist/row-host.d.ts +4 -2
- package/dist/row-host.js +90 -78
- package/dist/selection-ranges.js +21 -17
- package/dist/semantic-delta.js +22 -19
- package/dist/semantic-model.js +86 -73
- package/dist/semantic-tokens.js +201 -162
- package/dist/shortcut-keys.js +16 -10
- package/dist/signature-model.js +34 -28
- package/dist/signature.js +177 -129
- package/dist/snippet-field-transforms.js +118 -106
- package/dist/snippet-indent.js +48 -43
- package/dist/snippet-range-order.js +11 -11
- package/dist/snippet-session.js +703 -667
- package/dist/snippet-transform-client.js +59 -59
- package/dist/snippet-transform-format.js +285 -263
- package/dist/snippet-transform-protocol.js +1 -1
- package/dist/snippet-transform-queue.js +163 -153
- package/dist/snippet-transform-worker.js +42 -35
- package/dist/snippet-variable-names.js +1 -36
- package/dist/snippet-variables.js +53 -63
- package/dist/snippet.js +477 -405
- package/dist/split-alignment.js +47 -35
- package/dist/split-scroll.js +42 -40
- package/dist/symbol-links.js +33 -25
- package/dist/symbol-picker-model.js +126 -116
- package/dist/symbol-picker.js +98 -59
- package/dist/symbols.js +117 -88
- package/dist/testing.js +248 -165
- package/dist/timers.js +35 -30
- package/dist/use-panel-body.js +49 -8
- package/dist/use-problem-counts.js +29 -15
- package/dist/view-state.js +54 -33
- package/dist/word-diff.js +18 -18
- package/dist/workspace-edit.js +300 -249
- package/package.json +6 -6
- package/src/CallHierarchyPanel.tsx +2 -2
- package/src/DiffView.tsx +3 -3
- package/src/FindReplace.tsx +2 -2
- package/src/LanguagePopups.tsx +2 -0
- package/src/PeekPanel.tsx +3 -3
- package/src/RenderedDocs.tsx +9 -10
- package/src/SymbolPicker.tsx +2 -2
- package/src/diff-overlays.tsx +6 -4
- package/src/locales/en.json +38 -38
- package/src/locales/nl.json +41 -41
- package/src/rendered-docs.ts +14 -3
- package/src/row-host.ts +14 -3
package/dist/PickPopup.js
CHANGED
|
@@ -1,47 +1,317 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as _c } from "react/compiler-runtime";
|
|
2
2
|
import { useId, useLayoutEffect, useRef } from 'react';
|
|
3
3
|
import { createPortal } from 'react-dom';
|
|
4
|
-
import { PathText } from
|
|
4
|
+
import { PathText } from "./PathText.js";
|
|
5
5
|
import { keepFocusOutOfList } from './popup-focus.js';
|
|
6
6
|
import { placePopup } from './popup-placement.js';
|
|
7
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
8
|
const CARD = 'fixed top-0 left-0 z-(--z-popup) flex w-[420px] flex-col overflow-hidden rounded-lg border border-border bg-surface-raised text-text shadow-(--float-shadow)';
|
|
8
|
-
function PreviewLines(
|
|
9
|
-
|
|
9
|
+
function PreviewLines(t0) {
|
|
10
|
+
const $ = _c(13);
|
|
11
|
+
const {
|
|
12
|
+
preview
|
|
13
|
+
} = t0;
|
|
14
|
+
let t1;
|
|
15
|
+
if ($[0] !== preview.removed) {
|
|
16
|
+
t1 = preview.removed.map(_temp);
|
|
17
|
+
$[0] = preview.removed;
|
|
18
|
+
$[1] = t1;
|
|
19
|
+
} else {
|
|
20
|
+
t1 = $[1];
|
|
21
|
+
}
|
|
22
|
+
let t2;
|
|
23
|
+
if ($[2] !== preview.added) {
|
|
24
|
+
t2 = preview.added.map(_temp2);
|
|
25
|
+
$[2] = preview.added;
|
|
26
|
+
$[3] = t2;
|
|
27
|
+
} else {
|
|
28
|
+
t2 = $[3];
|
|
29
|
+
}
|
|
30
|
+
let t3;
|
|
31
|
+
if ($[4] !== preview.note) {
|
|
32
|
+
t3 = preview.note !== null && /*#__PURE__*/_jsx("div", {
|
|
33
|
+
className: "px-1.5 font-sans text-xs text-text-muted",
|
|
34
|
+
children: preview.note
|
|
35
|
+
});
|
|
36
|
+
$[4] = preview.note;
|
|
37
|
+
$[5] = t3;
|
|
38
|
+
} else {
|
|
39
|
+
t3 = $[5];
|
|
40
|
+
}
|
|
41
|
+
let t4;
|
|
42
|
+
if ($[6] !== preview.refusal) {
|
|
43
|
+
t4 = preview.refusal !== undefined && /*#__PURE__*/_jsx("div", {
|
|
44
|
+
role: "alert",
|
|
45
|
+
className: "px-1.5 py-0.5 font-sans text-xs text-status-error",
|
|
46
|
+
children: preview.refusal
|
|
47
|
+
});
|
|
48
|
+
$[6] = preview.refusal;
|
|
49
|
+
$[7] = t4;
|
|
50
|
+
} else {
|
|
51
|
+
t4 = $[7];
|
|
52
|
+
}
|
|
53
|
+
let t5;
|
|
54
|
+
if ($[8] !== t1 || $[9] !== t2 || $[10] !== t3 || $[11] !== t4) {
|
|
55
|
+
t5 = /*#__PURE__*/_jsxs("div", {
|
|
56
|
+
className: "flex flex-col gap-px border-t border-border p-1 font-mono text-code",
|
|
57
|
+
children: [t1, t2, t3, t4]
|
|
58
|
+
});
|
|
59
|
+
$[8] = t1;
|
|
60
|
+
$[9] = t2;
|
|
61
|
+
$[10] = t3;
|
|
62
|
+
$[11] = t4;
|
|
63
|
+
$[12] = t5;
|
|
64
|
+
} else {
|
|
65
|
+
t5 = $[12];
|
|
66
|
+
}
|
|
67
|
+
return t5;
|
|
10
68
|
}
|
|
11
69
|
/*
|
|
12
70
|
* The list of an editor's pick feature under the character it belongs to. A press on a row never takes
|
|
13
71
|
* the focus from the editor, so the keys keep going to it while the list is open.
|
|
14
72
|
*/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
},
|
|
34
|
-
|
|
73
|
+
function _temp2(line_0, index_0) {
|
|
74
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
75
|
+
className: "flex gap-2 rounded-sm bg-status-idle/10 px-1.5 whitespace-pre",
|
|
76
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
77
|
+
className: "text-status-idle",
|
|
78
|
+
children: "+"
|
|
79
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
80
|
+
className: "min-w-0 truncate",
|
|
81
|
+
children: line_0
|
|
82
|
+
})]
|
|
83
|
+
}, `+${index_0}`);
|
|
84
|
+
}
|
|
85
|
+
function _temp(line, index) {
|
|
86
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
87
|
+
className: "flex gap-2 rounded-sm bg-status-error/10 px-1.5 whitespace-pre",
|
|
88
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
89
|
+
className: "text-status-error",
|
|
90
|
+
children: "\u2212"
|
|
91
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
92
|
+
className: "min-w-0 truncate",
|
|
93
|
+
children: line
|
|
94
|
+
})]
|
|
95
|
+
}, `-${index}`);
|
|
96
|
+
}
|
|
97
|
+
export function PickPopup(t0) {
|
|
98
|
+
const $ = _c(39);
|
|
99
|
+
const {
|
|
100
|
+
language,
|
|
101
|
+
view,
|
|
102
|
+
rect
|
|
103
|
+
} = t0;
|
|
104
|
+
const listId = useId();
|
|
105
|
+
const card = useRef(null);
|
|
106
|
+
const activeRow = useRef(null);
|
|
107
|
+
let t1;
|
|
108
|
+
if ($[0] !== rect) {
|
|
109
|
+
t1 = () => {
|
|
110
|
+
const element = card.current;
|
|
111
|
+
if (element === null) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
const placed = placePopup(rect, {
|
|
115
|
+
width: element.offsetWidth,
|
|
116
|
+
height: element.offsetHeight
|
|
117
|
+
}, {
|
|
118
|
+
width: window.innerWidth,
|
|
119
|
+
height: window.innerHeight
|
|
120
|
+
}, {
|
|
121
|
+
gap: 2
|
|
122
|
+
});
|
|
123
|
+
element.style.left = `${Math.round(placed.left)}px`;
|
|
124
|
+
element.style.top = `${Math.round(placed.top)}px`;
|
|
125
|
+
element.style.maxHeight = `${Math.floor(placed.maxHeight)}px`;
|
|
126
|
+
element.style.visibility = "visible";
|
|
127
|
+
};
|
|
128
|
+
$[0] = rect;
|
|
129
|
+
$[1] = t1;
|
|
130
|
+
} else {
|
|
131
|
+
t1 = $[1];
|
|
132
|
+
}
|
|
133
|
+
useLayoutEffect(t1);
|
|
134
|
+
let t2;
|
|
135
|
+
if ($[2] === Symbol.for("react.memo_cache_sentinel")) {
|
|
136
|
+
t2 = () => {
|
|
137
|
+
activeRow.current?.scrollIntoView({
|
|
138
|
+
block: "nearest"
|
|
139
|
+
});
|
|
140
|
+
};
|
|
141
|
+
$[2] = t2;
|
|
142
|
+
} else {
|
|
143
|
+
t2 = $[2];
|
|
144
|
+
}
|
|
145
|
+
let t3;
|
|
146
|
+
if ($[3] !== view.active) {
|
|
147
|
+
t3 = [view.active];
|
|
148
|
+
$[3] = view.active;
|
|
149
|
+
$[4] = t3;
|
|
150
|
+
} else {
|
|
151
|
+
t3 = $[4];
|
|
152
|
+
}
|
|
153
|
+
useLayoutEffect(t2, t3);
|
|
154
|
+
let optionIds;
|
|
155
|
+
if ($[5] !== listId || $[6] !== view.groups) {
|
|
156
|
+
optionIds = new Map();
|
|
35
157
|
for (const group of view.groups) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
158
|
+
for (const row of group.rows) {
|
|
159
|
+
optionIds.set(row.id, `${listId}-option-${optionIds.size}`);
|
|
160
|
+
}
|
|
39
161
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
162
|
+
$[5] = listId;
|
|
163
|
+
$[6] = view.groups;
|
|
164
|
+
$[7] = optionIds;
|
|
165
|
+
} else {
|
|
166
|
+
optionIds = $[7];
|
|
167
|
+
}
|
|
168
|
+
let t4;
|
|
169
|
+
if ($[8] !== optionIds || $[9] !== view.active) {
|
|
170
|
+
t4 = optionIds.get(view.active);
|
|
171
|
+
$[8] = optionIds;
|
|
172
|
+
$[9] = view.active;
|
|
173
|
+
$[10] = t4;
|
|
174
|
+
} else {
|
|
175
|
+
t4 = $[10];
|
|
176
|
+
}
|
|
177
|
+
const activeId = t4;
|
|
178
|
+
let t5;
|
|
179
|
+
if ($[11] !== activeId || $[12] !== language.editor || $[13] !== listId) {
|
|
180
|
+
t5 = () => {
|
|
181
|
+
language.editor.setInputPopup({
|
|
182
|
+
controls: listId,
|
|
183
|
+
activeDescendant: activeId
|
|
184
|
+
});
|
|
185
|
+
return () => language.editor.setInputPopup(null);
|
|
186
|
+
};
|
|
187
|
+
$[11] = activeId;
|
|
188
|
+
$[12] = language.editor;
|
|
189
|
+
$[13] = listId;
|
|
190
|
+
$[14] = t5;
|
|
191
|
+
} else {
|
|
192
|
+
t5 = $[14];
|
|
193
|
+
}
|
|
194
|
+
let t6;
|
|
195
|
+
if ($[15] !== activeId || $[16] !== language || $[17] !== listId) {
|
|
196
|
+
t6 = [language, listId, activeId];
|
|
197
|
+
$[15] = activeId;
|
|
198
|
+
$[16] = language;
|
|
199
|
+
$[17] = listId;
|
|
200
|
+
$[18] = t6;
|
|
201
|
+
} else {
|
|
202
|
+
t6 = $[18];
|
|
203
|
+
}
|
|
204
|
+
useLayoutEffect(t5, t6);
|
|
205
|
+
let t7;
|
|
206
|
+
if ($[19] === Symbol.for("react.memo_cache_sentinel")) {
|
|
207
|
+
t7 = {
|
|
208
|
+
visibility: "hidden"
|
|
209
|
+
};
|
|
210
|
+
$[19] = t7;
|
|
211
|
+
} else {
|
|
212
|
+
t7 = $[19];
|
|
213
|
+
}
|
|
214
|
+
let t8;
|
|
215
|
+
if ($[20] !== language.editor) {
|
|
216
|
+
t8 = keepFocusOutOfList(() => language.editor.focus());
|
|
217
|
+
$[20] = language.editor;
|
|
218
|
+
$[21] = t8;
|
|
219
|
+
} else {
|
|
220
|
+
t8 = $[21];
|
|
221
|
+
}
|
|
222
|
+
let t9;
|
|
223
|
+
if ($[22] !== view.title) {
|
|
224
|
+
t9 = view.title !== null && /*#__PURE__*/_jsx("div", {
|
|
225
|
+
className: "border-b border-border px-3 py-1.5 text-xs text-text-muted",
|
|
226
|
+
children: view.title
|
|
227
|
+
});
|
|
228
|
+
$[22] = view.title;
|
|
229
|
+
$[23] = t9;
|
|
230
|
+
} else {
|
|
231
|
+
t9 = $[23];
|
|
232
|
+
}
|
|
233
|
+
let t10;
|
|
234
|
+
if ($[24] !== language.pick || $[25] !== optionIds || $[26] !== view.active || $[27] !== view.groups) {
|
|
235
|
+
t10 = view.groups.map((group_0, groupIndex) => /*#__PURE__*/_jsxs("div", {
|
|
236
|
+
role: "group",
|
|
237
|
+
className: "flex flex-col",
|
|
238
|
+
children: [group_0.title !== null && /*#__PURE__*/_jsx("div", {
|
|
239
|
+
className: "px-2 pt-1.5 pb-0.5 text-xs font-medium text-text-faint",
|
|
240
|
+
children: group_0.title
|
|
241
|
+
}), group_0.rows.map(row_0 => /*#__PURE__*/_jsxs("button", {
|
|
242
|
+
id: optionIds.get(row_0.id),
|
|
243
|
+
ref: row_0.id === view.active ? activeRow : undefined,
|
|
244
|
+
type: "button",
|
|
245
|
+
role: "option",
|
|
246
|
+
tabIndex: -1,
|
|
247
|
+
"aria-selected": row_0.id === view.active,
|
|
248
|
+
"data-active": row_0.id === view.active,
|
|
249
|
+
className: "flex h-7 w-full items-center gap-2 rounded-md px-2 text-left text-xs cursor-row",
|
|
250
|
+
onClick: () => language.pick.choose(row_0.id),
|
|
251
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
252
|
+
className: row_0.path ? "shrink-0" : "min-w-0 truncate",
|
|
253
|
+
children: row_0.label
|
|
254
|
+
}), row_0.path ? /*#__PURE__*/_jsx(PathText, {
|
|
255
|
+
path: row_0.detail,
|
|
256
|
+
className: "ml-auto font-mono text-text-faint"
|
|
257
|
+
}) : /*#__PURE__*/_jsx("span", {
|
|
258
|
+
className: "ml-auto shrink-0 font-mono text-text-faint",
|
|
259
|
+
children: row_0.id === view.active && row_0.detail === "" ? "\u21B5" : row_0.detail
|
|
260
|
+
})]
|
|
261
|
+
}, row_0.id))]
|
|
262
|
+
}, group_0.title ?? groupIndex));
|
|
263
|
+
$[24] = language.pick;
|
|
264
|
+
$[25] = optionIds;
|
|
265
|
+
$[26] = view.active;
|
|
266
|
+
$[27] = view.groups;
|
|
267
|
+
$[28] = t10;
|
|
268
|
+
} else {
|
|
269
|
+
t10 = $[28];
|
|
270
|
+
}
|
|
271
|
+
let t11;
|
|
272
|
+
if ($[29] !== listId || $[30] !== t10) {
|
|
273
|
+
t11 = /*#__PURE__*/_jsx("div", {
|
|
274
|
+
id: listId,
|
|
275
|
+
role: "listbox",
|
|
276
|
+
className: "min-h-0 flex-1 overflow-y-auto p-1",
|
|
277
|
+
children: t10
|
|
278
|
+
});
|
|
279
|
+
$[29] = listId;
|
|
280
|
+
$[30] = t10;
|
|
281
|
+
$[31] = t11;
|
|
282
|
+
} else {
|
|
283
|
+
t11 = $[31];
|
|
284
|
+
}
|
|
285
|
+
let t12;
|
|
286
|
+
if ($[32] !== view.preview) {
|
|
287
|
+
t12 = view.preview !== null && /*#__PURE__*/_jsx(PreviewLines, {
|
|
288
|
+
preview: view.preview
|
|
289
|
+
});
|
|
290
|
+
$[32] = view.preview;
|
|
291
|
+
$[33] = t12;
|
|
292
|
+
} else {
|
|
293
|
+
t12 = $[33];
|
|
294
|
+
}
|
|
295
|
+
let t13;
|
|
296
|
+
if ($[34] !== t11 || $[35] !== t12 || $[36] !== t8 || $[37] !== t9) {
|
|
297
|
+
t13 = createPortal(/*#__PURE__*/_jsxs("div", {
|
|
298
|
+
ref: card,
|
|
299
|
+
className: CARD,
|
|
300
|
+
style: t7,
|
|
301
|
+
onPointerDown: _temp3,
|
|
302
|
+
...t8,
|
|
303
|
+
children: [t9, t11, t12]
|
|
304
|
+
}), document.body);
|
|
305
|
+
$[34] = t11;
|
|
306
|
+
$[35] = t12;
|
|
307
|
+
$[36] = t8;
|
|
308
|
+
$[37] = t9;
|
|
309
|
+
$[38] = t13;
|
|
310
|
+
} else {
|
|
311
|
+
t13 = $[38];
|
|
312
|
+
}
|
|
313
|
+
return t13;
|
|
47
314
|
}
|
|
315
|
+
function _temp3(event) {
|
|
316
|
+
return event.preventDefault();
|
|
317
|
+
}
|