@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.
- package/dist/CallHierarchyPanel.js +30 -55
- package/dist/CodeAuthorsCard.js +0 -1
- package/dist/CompletionPopup.js +150 -181
- package/dist/DiffView.d.ts +1 -1
- package/dist/DiffView.js +2 -29
- package/dist/PickPopup.js +54 -80
- package/dist/SplitDiffView.js +27 -57
- package/dist/SymbolPicker.js +2 -8
- package/dist/code-actions-model.js +2 -9
- package/dist/code-actions.js +10 -11
- package/dist/code-vision.js +2 -1
- package/dist/completion-model.js +2 -2
- package/dist/completion.js +13 -34
- package/dist/definition-link.d.ts +1 -0
- package/dist/definition-link.js +22 -18
- package/dist/diagnostics-model.d.ts +1 -0
- package/dist/diagnostics-model.js +3 -1
- package/dist/diagnostics.js +1 -2
- package/dist/diff-syntax.d.ts +1 -0
- package/dist/diff-syntax.js +31 -0
- package/dist/doc-comment-model.d.ts +1 -0
- package/dist/doc-comment-model.js +1 -1
- package/dist/folding.js +2 -3
- package/dist/format-on-type.js +6 -10
- package/dist/hover-content.d.ts +0 -2
- package/dist/hover-content.js +1 -9
- package/dist/inlay-hints.d.ts +0 -1
- package/dist/inlay-hints.js +11 -41
- package/dist/navigation.js +4 -14
- package/dist/peek.js +2 -12
- package/dist/popup-focus.d.ts +3 -1
- package/dist/popup-focus.js +33 -0
- package/dist/recent-choices.d.ts +0 -1
- package/dist/recent-choices.js +0 -4
- package/dist/rendered-docs.d.ts +1 -0
- package/dist/rendered-docs.js +15 -28
- package/dist/snippet-field-transforms.d.ts +5 -0
- package/dist/snippet-field-transforms.js +27 -16
- package/dist/snippet-session.js +8 -20
- package/dist/symbol-links.js +3 -10
- package/dist/symbol-picker-model.d.ts +1 -0
- package/dist/symbol-picker-model.js +7 -0
- package/dist/unique.d.ts +10 -0
- package/dist/unique.js +15 -0
- package/package.json +9 -9
- package/src/AnchoredPopup.tsx +2 -0
- package/src/BaselineStatus.tsx +1 -0
- package/src/CallHierarchyPanel.tsx +16 -6
- package/src/ChangeReview.tsx +7 -0
- package/src/CodeAuthorsCard.tsx +2 -5
- package/src/CompletionPopup.tsx +21 -15
- package/src/DiffView.tsx +53 -30
- package/src/EditorContextMenu.tsx +7 -0
- package/src/EditorView.tsx +28 -0
- package/src/FindReplace.tsx +8 -0
- package/src/HoverCard.tsx +8 -0
- package/src/HoverSections.tsx +11 -0
- package/src/LanguagePopups.tsx +1 -0
- package/src/PanelResizeHandle.tsx +8 -0
- package/src/PathText.tsx +1 -0
- package/src/PeekPanel.tsx +13 -0
- package/src/PickPopup.tsx +7 -6
- package/src/RenameCard.tsx +13 -0
- package/src/RenderedDocs.tsx +11 -0
- package/src/SplitDiffView.tsx +91 -56
- package/src/SymbolPicker.tsx +10 -18
- package/src/call-hierarchy-model.ts +10 -0
- package/src/call-hierarchy.ts +82 -0
- package/src/code-actions-model.ts +21 -9
- package/src/code-actions.ts +83 -7
- package/src/code-authors.ts +20 -0
- package/src/code-vision-model.ts +37 -0
- package/src/code-vision.ts +47 -3
- package/src/completion-call.ts +19 -0
- package/src/completion-model.ts +58 -2
- package/src/completion.ts +156 -30
- package/src/conflict-model.ts +4 -0
- package/src/context-menu-rows.ts +1 -0
- package/src/context-menu.ts +7 -0
- package/src/definition-link.ts +42 -18
- package/src/diagnostics-model.ts +19 -1
- package/src/diagnostics.ts +31 -2
- package/src/diff-expansion.ts +9 -0
- package/src/diff-overlays.tsx +8 -0
- package/src/diff-syntax.ts +54 -0
- package/src/diff-wordmarks.ts +8 -0
- package/src/doc-comment-model.ts +51 -1
- package/src/editor-language.ts +11 -0
- package/src/find-query.ts +7 -0
- package/src/folding.ts +10 -3
- package/src/format-on-type.ts +23 -10
- package/src/highlight-layers.ts +3 -0
- package/src/highlights.ts +18 -0
- package/src/history.ts +11 -0
- package/src/holder.ts +3 -0
- package/src/hover-content.ts +34 -17
- package/src/hover.ts +57 -0
- package/src/index.ts +4 -0
- package/src/inlay-hints.ts +86 -47
- package/src/key-priority.ts +2 -0
- package/src/line-edits.ts +8 -0
- package/src/models.ts +6 -0
- package/src/navigation-history.ts +5 -0
- package/src/navigation.ts +28 -13
- package/src/panel-size.ts +7 -0
- package/src/patch-decorations.ts +39 -0
- package/src/patch-layout.ts +47 -0
- package/src/peek-model.ts +21 -0
- package/src/peek.ts +49 -13
- package/src/pick.ts +35 -0
- package/src/popup-focus.ts +11 -1
- package/src/popup-placement.ts +5 -0
- package/src/popups.ts +2 -6
- package/src/project-language.ts +33 -0
- package/src/project-problems.ts +11 -0
- package/src/proposal-model.ts +40 -0
- package/src/recent-choices.ts +3 -5
- package/src/refresher.ts +3 -0
- package/src/rename-model.ts +28 -0
- package/src/rename.ts +56 -0
- package/src/rendered-docs.ts +89 -19
- package/src/review-group.ts +4 -0
- package/src/row-host.ts +12 -0
- package/src/selection-ranges.ts +6 -0
- package/src/semantic-delta.ts +7 -0
- package/src/semantic-model.ts +11 -0
- package/src/semantic-tokens.ts +37 -0
- package/src/shortcut-keys.ts +3 -0
- package/src/signature-model.ts +7 -0
- package/src/signature.ts +27 -0
- package/src/snippet-field-transforms.ts +48 -13
- package/src/snippet-indent.ts +10 -0
- package/src/snippet-range-order.ts +5 -0
- package/src/snippet-session.ts +173 -31
- package/src/snippet-transform-client.ts +14 -0
- package/src/snippet-transform-format.ts +98 -0
- package/src/snippet-transform-protocol.ts +5 -0
- package/src/snippet-transform-queue.ts +53 -0
- package/src/snippet-transform-worker.ts +14 -0
- package/src/snippet-variables.ts +9 -0
- package/src/snippet.ts +107 -0
- package/src/split-alignment.ts +10 -0
- package/src/split-scroll.ts +8 -0
- package/src/symbol-links.ts +9 -12
- package/src/symbol-picker-model.ts +25 -0
- package/src/symbol-picker.ts +9 -0
- package/src/symbols.ts +21 -0
- package/src/testing.ts +7 -0
- package/src/timers.ts +5 -0
- package/src/unique.ts +23 -0
- package/src/use-problem-counts.ts +4 -0
- package/src/view-state.ts +9 -0
- package/src/word-diff.ts +5 -0
- 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,
|
|
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(
|
|
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] !==
|
|
431
|
-
t5 = ()
|
|
432
|
-
|
|
433
|
-
|
|
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 = $[
|
|
437
|
+
t5 = $[10];
|
|
444
438
|
}
|
|
445
439
|
let t6;
|
|
446
|
-
if ($[13] !==
|
|
447
|
-
t6 =
|
|
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
|
-
$[
|
|
508
|
-
$[
|
|
509
|
-
$[
|
|
510
|
-
$[
|
|
511
|
-
$[
|
|
512
|
-
$[
|
|
513
|
-
$[
|
|
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
|
-
|
|
490
|
+
t6 = $[17];
|
|
516
491
|
}
|
|
517
|
-
let
|
|
518
|
-
if ($[
|
|
519
|
-
|
|
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":
|
|
497
|
+
"aria-label": t5,
|
|
523
498
|
className: "w-1/2 shrink-0 overflow-y-auto border-r border-border py-1",
|
|
524
|
-
children:
|
|
499
|
+
children: t6
|
|
525
500
|
});
|
|
526
|
-
$[
|
|
527
|
-
$[
|
|
528
|
-
$[
|
|
529
|
-
$[
|
|
501
|
+
$[18] = t5;
|
|
502
|
+
$[19] = t6;
|
|
503
|
+
$[20] = treeId;
|
|
504
|
+
$[21] = t7;
|
|
530
505
|
} else {
|
|
531
|
-
|
|
506
|
+
t7 = $[21];
|
|
532
507
|
}
|
|
533
|
-
return
|
|
508
|
+
return t7;
|
|
534
509
|
}
|
|
535
510
|
function StatusText(t0) {
|
|
536
511
|
const $ = _c(15);
|
package/dist/CodeAuthorsCard.js
CHANGED
|
@@ -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';
|
package/dist/CompletionPopup.js
CHANGED
|
@@ -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 {
|
|
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(
|
|
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]
|
|
224
|
-
t8 =
|
|
225
|
-
|
|
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] =
|
|
232
|
-
$[17] = language.editor;
|
|
233
|
-
$[18] = listId;
|
|
234
|
-
$[19] = t8;
|
|
223
|
+
$[16] = t8;
|
|
235
224
|
} else {
|
|
236
|
-
t8 = $[
|
|
225
|
+
t8 = $[16];
|
|
237
226
|
}
|
|
238
227
|
let t9;
|
|
239
|
-
if ($[
|
|
240
|
-
t9 =
|
|
241
|
-
$[
|
|
242
|
-
$[
|
|
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
|
-
|
|
233
|
+
t9 = $[18];
|
|
257
234
|
}
|
|
235
|
+
const t10 = `calc(${Math.max(widest, need)}ch + ${ROW_CHROME}px)`;
|
|
258
236
|
let t11;
|
|
259
|
-
if ($[
|
|
260
|
-
t11 =
|
|
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:
|
|
242
|
+
width: t10
|
|
274
243
|
}
|
|
275
244
|
});
|
|
276
|
-
$[
|
|
277
|
-
$[
|
|
245
|
+
$[19] = t10;
|
|
246
|
+
$[20] = t11;
|
|
278
247
|
} else {
|
|
279
|
-
|
|
248
|
+
t11 = $[20];
|
|
280
249
|
}
|
|
281
|
-
let
|
|
282
|
-
let
|
|
283
|
-
if ($[
|
|
284
|
-
|
|
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
|
-
|
|
288
|
-
$[
|
|
289
|
-
$[
|
|
256
|
+
t13 = event_0 => setListTop(event_0.currentTarget.scrollTop);
|
|
257
|
+
$[21] = t12;
|
|
258
|
+
$[22] = t13;
|
|
290
259
|
} else {
|
|
291
|
-
|
|
292
|
-
|
|
260
|
+
t12 = $[21];
|
|
261
|
+
t13 = $[22];
|
|
293
262
|
}
|
|
294
|
-
const
|
|
295
|
-
let
|
|
296
|
-
if ($[
|
|
297
|
-
|
|
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:
|
|
269
|
+
height: t14
|
|
301
270
|
}
|
|
302
271
|
});
|
|
303
|
-
$[
|
|
304
|
-
$[
|
|
272
|
+
$[23] = t14;
|
|
273
|
+
$[24] = t15;
|
|
305
274
|
} else {
|
|
306
|
-
|
|
275
|
+
t15 = $[24];
|
|
307
276
|
}
|
|
308
|
-
let
|
|
309
|
-
if ($[
|
|
310
|
-
|
|
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 ${
|
|
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
|
-
$[
|
|
343
|
-
$[
|
|
344
|
-
$[
|
|
345
|
-
$[
|
|
346
|
-
$[
|
|
347
|
-
$[
|
|
348
|
-
$[
|
|
349
|
-
$[
|
|
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
|
-
|
|
320
|
+
t16 = $[32];
|
|
352
321
|
}
|
|
353
|
-
const
|
|
354
|
-
let
|
|
355
|
-
if ($[
|
|
356
|
-
|
|
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:
|
|
328
|
+
height: t17
|
|
360
329
|
}
|
|
361
330
|
});
|
|
362
|
-
$[
|
|
363
|
-
$[
|
|
331
|
+
$[33] = t17;
|
|
332
|
+
$[34] = t18;
|
|
364
333
|
} else {
|
|
365
|
-
|
|
334
|
+
t18 = $[34];
|
|
366
335
|
}
|
|
367
|
-
let
|
|
368
|
-
if ($[
|
|
369
|
-
|
|
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:
|
|
374
|
-
onScroll:
|
|
375
|
-
children: [
|
|
342
|
+
style: t12,
|
|
343
|
+
onScroll: t13,
|
|
344
|
+
children: [t15, t16, t18]
|
|
376
345
|
});
|
|
377
|
-
$[
|
|
378
|
-
$[
|
|
379
|
-
$[
|
|
380
|
-
$[
|
|
381
|
-
$[
|
|
346
|
+
$[35] = listId;
|
|
347
|
+
$[36] = t15;
|
|
348
|
+
$[37] = t16;
|
|
349
|
+
$[38] = t18;
|
|
350
|
+
$[39] = t19;
|
|
382
351
|
} else {
|
|
383
|
-
|
|
352
|
+
t19 = $[39];
|
|
384
353
|
}
|
|
385
|
-
let
|
|
386
|
-
if ($[
|
|
387
|
-
|
|
388
|
-
$[
|
|
389
|
-
$[
|
|
354
|
+
let t20;
|
|
355
|
+
if ($[40] !== t) {
|
|
356
|
+
t20 = t("language.completion.insert");
|
|
357
|
+
$[40] = t;
|
|
358
|
+
$[41] = t20;
|
|
390
359
|
} else {
|
|
391
|
-
|
|
360
|
+
t20 = $[41];
|
|
392
361
|
}
|
|
393
|
-
let
|
|
394
|
-
if ($[
|
|
395
|
-
|
|
396
|
-
children: ["\u21B5 ",
|
|
362
|
+
let t21;
|
|
363
|
+
if ($[42] !== t20) {
|
|
364
|
+
t21 = /*#__PURE__*/_jsxs("span", {
|
|
365
|
+
children: ["\u21B5 ", t20]
|
|
397
366
|
});
|
|
398
|
-
$[
|
|
399
|
-
$[
|
|
367
|
+
$[42] = t20;
|
|
368
|
+
$[43] = t21;
|
|
400
369
|
} else {
|
|
401
|
-
|
|
370
|
+
t21 = $[43];
|
|
402
371
|
}
|
|
403
|
-
let
|
|
404
|
-
if ($[
|
|
405
|
-
|
|
406
|
-
$[
|
|
407
|
-
$[
|
|
372
|
+
let t22;
|
|
373
|
+
if ($[44] !== t) {
|
|
374
|
+
t22 = t("language.completion.replace");
|
|
375
|
+
$[44] = t;
|
|
376
|
+
$[45] = t22;
|
|
408
377
|
} else {
|
|
409
|
-
|
|
378
|
+
t22 = $[45];
|
|
410
379
|
}
|
|
411
|
-
let
|
|
412
|
-
if ($[
|
|
413
|
-
|
|
414
|
-
children: ["\u21E5 ",
|
|
380
|
+
let t23;
|
|
381
|
+
if ($[46] !== t22) {
|
|
382
|
+
t23 = /*#__PURE__*/_jsxs("span", {
|
|
383
|
+
children: ["\u21E5 ", t22]
|
|
415
384
|
});
|
|
416
|
-
$[
|
|
417
|
-
$[
|
|
385
|
+
$[46] = t22;
|
|
386
|
+
$[47] = t23;
|
|
418
387
|
} else {
|
|
419
|
-
|
|
388
|
+
t23 = $[47];
|
|
420
389
|
}
|
|
421
|
-
let
|
|
422
|
-
if ($[
|
|
423
|
-
|
|
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
|
-
$[
|
|
427
|
-
$[
|
|
428
|
-
$[
|
|
395
|
+
$[48] = detailsKey;
|
|
396
|
+
$[49] = t;
|
|
397
|
+
$[50] = t24;
|
|
429
398
|
} else {
|
|
430
|
-
|
|
399
|
+
t24 = $[50];
|
|
431
400
|
}
|
|
432
|
-
let
|
|
433
|
-
if ($[
|
|
434
|
-
|
|
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
|
-
$[
|
|
439
|
-
$[
|
|
407
|
+
$[51] = view.server;
|
|
408
|
+
$[52] = t25;
|
|
440
409
|
} else {
|
|
441
|
-
|
|
410
|
+
t25 = $[52];
|
|
442
411
|
}
|
|
443
|
-
let
|
|
444
|
-
if ($[
|
|
445
|
-
|
|
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: [
|
|
416
|
+
children: [t21, t23, t24, t25]
|
|
448
417
|
});
|
|
449
|
-
$[
|
|
450
|
-
$[
|
|
451
|
-
$[
|
|
452
|
-
$[
|
|
453
|
-
$[
|
|
418
|
+
$[53] = t21;
|
|
419
|
+
$[54] = t23;
|
|
420
|
+
$[55] = t24;
|
|
421
|
+
$[56] = t25;
|
|
422
|
+
$[57] = t26;
|
|
454
423
|
} else {
|
|
455
|
-
|
|
424
|
+
t26 = $[57];
|
|
456
425
|
}
|
|
457
|
-
let
|
|
458
|
-
if ($[
|
|
459
|
-
|
|
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:
|
|
431
|
+
style: t8,
|
|
463
432
|
onPointerDown: _temp3,
|
|
464
|
-
...
|
|
465
|
-
children: [
|
|
433
|
+
...t9,
|
|
434
|
+
children: [t11, t19, t26]
|
|
466
435
|
});
|
|
467
|
-
$[
|
|
468
|
-
$[
|
|
469
|
-
$[
|
|
470
|
-
$[
|
|
471
|
-
$[
|
|
436
|
+
$[58] = t11;
|
|
437
|
+
$[59] = t19;
|
|
438
|
+
$[60] = t26;
|
|
439
|
+
$[61] = t9;
|
|
440
|
+
$[62] = t27;
|
|
472
441
|
} else {
|
|
473
|
-
|
|
442
|
+
t27 = $[62];
|
|
474
443
|
}
|
|
475
|
-
let
|
|
476
|
-
if ($[
|
|
477
|
-
|
|
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
|
-
$[
|
|
495
|
-
$[
|
|
496
|
-
$[
|
|
497
|
-
$[
|
|
463
|
+
$[63] = view.detailsOpen;
|
|
464
|
+
$[64] = view.docs;
|
|
465
|
+
$[65] = view.highlightLanguage;
|
|
466
|
+
$[66] = t28;
|
|
498
467
|
} else {
|
|
499
|
-
|
|
468
|
+
t28 = $[66];
|
|
500
469
|
}
|
|
501
|
-
let
|
|
502
|
-
if ($[
|
|
503
|
-
|
|
504
|
-
children: [
|
|
470
|
+
let t29;
|
|
471
|
+
if ($[67] !== t27 || $[68] !== t28) {
|
|
472
|
+
t29 = createPortal(/*#__PURE__*/_jsxs(_Fragment, {
|
|
473
|
+
children: [t27, t28]
|
|
505
474
|
}), document.body);
|
|
506
|
-
$[
|
|
507
|
-
$[
|
|
508
|
-
$[
|
|
475
|
+
$[67] = t27;
|
|
476
|
+
$[68] = t28;
|
|
477
|
+
$[69] = t29;
|
|
509
478
|
} else {
|
|
510
|
-
|
|
479
|
+
t29 = $[69];
|
|
511
480
|
}
|
|
512
|
-
return
|
|
481
|
+
return t29;
|
|
513
482
|
}
|
|
514
483
|
function _temp4(event_1) {
|
|
515
484
|
return event_1.preventDefault();
|
package/dist/DiffView.d.ts
CHANGED
|
@@ -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
|
|
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
|
-
|
|
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;
|