@dou-ui/code 0.1.0-alpha.1 → 0.1.0-alpha.11
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/code-diff.js.map +1 -1
- package/dist/code-diff.vue_vue_type_script_setup_true_lang.js +491 -17
- package/dist/code-diff.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/code-editor.js.map +1 -1
- package/dist/code-editor.vue_vue_type_script_setup_true_lang.js +176 -54
- package/dist/code-editor.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/extension.js +6 -1
- package/dist/extension.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/code-diff.vue.d.ts +5 -2
- package/dist/types/code-editor.vue.d.ts +1 -0
- package/dist/types/extension.d.ts +44 -4
- package/dist/types/index.d.ts +7 -3
- package/dist/types/types.d.ts +89 -3
- package/package.json +3 -3
|
@@ -15,7 +15,7 @@ import { SyntaxWorkerClient, holdWorker, ownWorker } from "./language/worker-cli
|
|
|
15
15
|
import { format, useCodeMessages } from "./locale.js";
|
|
16
16
|
import { visibleViewport } from "./view/viewport.js";
|
|
17
17
|
import code_keys_default from "./code-keys2.js";
|
|
18
|
-
import { CODE_EDITOR_KEY } from "./extension.js";
|
|
18
|
+
import { CODE_EDITOR_KEY, WIDGET_HEIGHT_KEY } from "./extension.js";
|
|
19
19
|
import render_part_default from "./render-part.js";
|
|
20
20
|
import { matchCompletion } from "./completion/match.js";
|
|
21
21
|
import { parseSnippet } from "./completion/snippet.js";
|
|
@@ -23,33 +23,38 @@ import { diffText } from "./view/input.js";
|
|
|
23
23
|
import { LineLayout, UNWRAPPED, rowOfCol, updateRows, wrapLine } from "./view/layout.js";
|
|
24
24
|
import { Measure } from "./view/measure.js";
|
|
25
25
|
import { DouFindReplace, DouToggle, DouTooltip, holdPointer, isApplePlatform, isComposing, scrollPositionOf, useLocale, useNamespace, useTeleport, useZIndex } from "dou-ui";
|
|
26
|
-
import { Fragment, Teleport, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, getCurrentInstance, isMemoSame, markRaw, nextTick, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, openBlock, provide, reactive, ref, renderList, resolveDynamicComponent, shallowReactive, shallowRef, toDisplayString, toRaw, unref, watch, withCtx, withModifiers } from "vue";
|
|
26
|
+
import { Fragment, Teleport, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, getCurrentInstance, inject, isMemoSame, markRaw, mergeProps, nextTick, normalizeClass, normalizeStyle, onBeforeUnmount, onMounted, openBlock, provide, reactive, ref, renderList, resolveDynamicComponent, shallowReactive, shallowRef, toDisplayString, toRaw, unref, watch, withCtx, withModifiers } from "vue";
|
|
27
27
|
import { AlertTriangleIcon, ChevronDownIcon, ChevronRightIcon, FunctionIcon, GripVerticalIcon, InfoIcon, LetterCaseIcon, LightbulbIcon, PackageIcon, RegexIcon, SquareCodeIcon, SymbolClassIcon, SymbolConstantIcon, SymbolKeywordIcon, SymbolTypeAliasIcon, TypeIcon, VariableIcon, WholeWordIcon, WrenchIcon, XCircleIcon } from "@dou-ui/icons";
|
|
28
28
|
// src/code-editor.vue?vue&type=script&setup=true&lang.ts
|
|
29
29
|
var _hoisted_1 = [
|
|
30
30
|
"title",
|
|
31
31
|
"data-gutter-cell",
|
|
32
|
-
"data-line"
|
|
32
|
+
"data-line",
|
|
33
|
+
"onKeydown"
|
|
33
34
|
];
|
|
34
|
-
var _hoisted_2 =
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
var
|
|
39
|
-
var
|
|
40
|
-
var
|
|
41
|
-
var
|
|
42
|
-
var
|
|
35
|
+
var _hoisted_2 = {
|
|
36
|
+
key: 1,
|
|
37
|
+
"aria-hidden": "true"
|
|
38
|
+
};
|
|
39
|
+
var _hoisted_3 = ["data-fold"];
|
|
40
|
+
var _hoisted_4 = ["title"];
|
|
41
|
+
var _hoisted_5 = ["data-unfold", "title"];
|
|
42
|
+
var _hoisted_6 = ["title"];
|
|
43
|
+
var _hoisted_7 = ["data-unfold", "title"];
|
|
44
|
+
var _hoisted_8 = ["aria-label"];
|
|
45
|
+
var _hoisted_9 = ["aria-current", "onClick"];
|
|
46
|
+
var _hoisted_10 = ["aria-label"];
|
|
47
|
+
var _hoisted_11 = [
|
|
43
48
|
"id",
|
|
44
49
|
"aria-selected",
|
|
45
50
|
"onClick"
|
|
46
51
|
];
|
|
47
|
-
var
|
|
48
|
-
var
|
|
49
|
-
var
|
|
50
|
-
var
|
|
51
|
-
var
|
|
52
|
-
var
|
|
52
|
+
var _hoisted_12 = ["aria-label"];
|
|
53
|
+
var _hoisted_13 = ["onPointerdown"];
|
|
54
|
+
var _hoisted_14 = ["title"];
|
|
55
|
+
var _hoisted_15 = ["aria-label"];
|
|
56
|
+
var _hoisted_16 = ["onClick"];
|
|
57
|
+
var _hoisted_17 = [
|
|
53
58
|
"aria-label",
|
|
54
59
|
"aria-placeholder",
|
|
55
60
|
"aria-autocomplete",
|
|
@@ -57,8 +62,8 @@ var _hoisted_16 = [
|
|
|
57
62
|
"readonly",
|
|
58
63
|
"disabled"
|
|
59
64
|
];
|
|
60
|
-
var
|
|
61
|
-
var
|
|
65
|
+
var _hoisted_18 = ["role", "aria-label"];
|
|
66
|
+
var _hoisted_19 = ["aria-label", "title"];
|
|
62
67
|
var MAX_HEIGHT = 8e6;
|
|
63
68
|
var OVERSCAN = 6;
|
|
64
69
|
/** The textarea mirrors at most this much text around the cursor. */
|
|
@@ -96,6 +101,10 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
96
101
|
type: Boolean,
|
|
97
102
|
default: true
|
|
98
103
|
},
|
|
104
|
+
bordered: {
|
|
105
|
+
type: Boolean,
|
|
106
|
+
default: true
|
|
107
|
+
},
|
|
99
108
|
activeLine: {
|
|
100
109
|
type: Boolean,
|
|
101
110
|
default: true
|
|
@@ -546,6 +555,7 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
546
555
|
});
|
|
547
556
|
/** The widgets' heights as last measured, by key. */
|
|
548
557
|
const widgetHeights = shallowReactive(/* @__PURE__ */ new Map());
|
|
558
|
+
const onWidgetHeight = inject(WIDGET_HEIGHT_KEY, null);
|
|
549
559
|
const widgets = computed(() => {
|
|
550
560
|
const drawn = layout.value;
|
|
551
561
|
const lh = lineHeight.value;
|
|
@@ -669,7 +679,10 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
669
679
|
const id = observedWidgets.get(target);
|
|
670
680
|
if (!id || !target.isConnected) return;
|
|
671
681
|
const height = target.offsetHeight;
|
|
672
|
-
if (height && widgetHeights.get(id) !== height)
|
|
682
|
+
if (height && widgetHeights.get(id) !== height) {
|
|
683
|
+
onWidgetHeight?.(id, height);
|
|
684
|
+
widgetHeights.set(id, height);
|
|
685
|
+
}
|
|
673
686
|
};
|
|
674
687
|
measureNow(el);
|
|
675
688
|
if (typeof ResizeObserver === "undefined") return;
|
|
@@ -794,12 +807,28 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
794
807
|
for (const extension of extensions.value) for (const gutter of extension.gutters ?? []) columns.push({
|
|
795
808
|
name: gutter.name,
|
|
796
809
|
width: gutter.width ?? 16,
|
|
797
|
-
markers: () => gutter.markers(context),
|
|
798
|
-
onPress: gutter.onPress && ((line, event) => gutter.onPress(line, event, context))
|
|
810
|
+
markers: () => withHoverMarker(gutter.markers?.(context) ?? [], gutter.hoverMarker),
|
|
811
|
+
onPress: gutter.onPress && ((line, event) => gutter.onPress(line, event, context)),
|
|
812
|
+
pressOn: gutter.pressOn
|
|
799
813
|
});
|
|
800
814
|
return columns;
|
|
801
815
|
});
|
|
802
816
|
const gutterCells = computed(() => gutterColumns.value.reduce((sum, column) => sum + column.width, 0));
|
|
817
|
+
/** A column's markers, and its `hoverMarker` on the other lines in view. */
|
|
818
|
+
function withHoverMarker(own, hover) {
|
|
819
|
+
if (!hover) return own;
|
|
820
|
+
const taken = new Set(own.map((marker) => marker.line));
|
|
821
|
+
const out = [...own];
|
|
822
|
+
for (let line = visibleFrom.value; line <= visibleTo.value; line++) if (!taken.has(line)) out.push({
|
|
823
|
+
icon: hover.icon,
|
|
824
|
+
text: hover.text,
|
|
825
|
+
class: hover.class,
|
|
826
|
+
title: typeof hover.title === "function" ? hover.title(line) : hover.title,
|
|
827
|
+
line,
|
|
828
|
+
visible: "hover"
|
|
829
|
+
});
|
|
830
|
+
return out;
|
|
831
|
+
}
|
|
803
832
|
/** The worst problem on each line in view, as a marker. */
|
|
804
833
|
function problemMarkers() {
|
|
805
834
|
const text = doc.value;
|
|
@@ -823,9 +852,40 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
823
852
|
}));
|
|
824
853
|
}
|
|
825
854
|
/** The markers of each column, by line, for the lines in view. */
|
|
855
|
+
/** The line the mouse is over in the text, so the gutter can show markers waiting for it. */
|
|
856
|
+
const hoveredLine = ref(null);
|
|
857
|
+
function lineAtY(y) {
|
|
858
|
+
const rect = content.value?.getBoundingClientRect();
|
|
859
|
+
if (!rect) return null;
|
|
860
|
+
return doc.value.lineAt(posAtCoords({
|
|
861
|
+
x: rect.left + 1,
|
|
862
|
+
y
|
|
863
|
+
})).number;
|
|
864
|
+
}
|
|
865
|
+
/** A marker in a pressable column is a button: Enter or Space presses it. */
|
|
866
|
+
function onCellKeydown(event, column, line) {
|
|
867
|
+
if (event.key !== "Enter" && event.key !== " ") return;
|
|
868
|
+
const press = gutterColumns.value[column]?.onPress;
|
|
869
|
+
if (!press || props.disabled) return;
|
|
870
|
+
event.preventDefault();
|
|
871
|
+
const cell = event.currentTarget;
|
|
872
|
+
press(line, event);
|
|
873
|
+
nextTick(() => {
|
|
874
|
+
const where = document.activeElement;
|
|
875
|
+
if ((!cell.isConnected || cell.getAttribute("role") !== "button") && (!where || where === document.body || where === cell)) focusInput();
|
|
876
|
+
});
|
|
877
|
+
}
|
|
878
|
+
/** Columns already warned about markers without a name, while developing. */
|
|
879
|
+
const unnamed = /* @__PURE__ */ new Set();
|
|
826
880
|
const gutterMarkers = computed(() => gutterColumns.value.map((column) => {
|
|
827
881
|
const byLine = /* @__PURE__ */ new Map();
|
|
828
|
-
for (const marker of column.markers())
|
|
882
|
+
for (const marker of column.markers()) {
|
|
883
|
+
byLine.set(marker.line, marker);
|
|
884
|
+
if (process.env.NODE_ENV !== "production" && column.onPress && !marker.title) {
|
|
885
|
+
if (!unnamed.has(column.name)) console.warn(`[@dou-ui/code] gutter "${column.name}": a marker in a column with \`onPress\` is a button and needs a \`title\` to name it.`);
|
|
886
|
+
unnamed.add(column.name);
|
|
887
|
+
}
|
|
888
|
+
}
|
|
829
889
|
return byLine;
|
|
830
890
|
}));
|
|
831
891
|
const gutterWidth = computed(() => {
|
|
@@ -2062,6 +2122,7 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
2062
2122
|
* the mouse events a browser makes up after it would only close it again.
|
|
2063
2123
|
*/
|
|
2064
2124
|
function onContentHover(event) {
|
|
2125
|
+
if (event.pointerType === "mouse") hoveredLine.value = lineAtY(event.clientY);
|
|
2065
2126
|
if (event.pointerType !== "mouse" || drag || problemBox.value?.keyboard) return;
|
|
2066
2127
|
if (!content.value?.getBoundingClientRect()) return;
|
|
2067
2128
|
const point = {
|
|
@@ -2085,6 +2146,7 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
2085
2146
|
clearTimeout(problemTimer);
|
|
2086
2147
|
}
|
|
2087
2148
|
function onContentLeave(event) {
|
|
2149
|
+
hoveredLine.value = null;
|
|
2088
2150
|
if (event.pointerType !== "mouse" || problemBox.value?.keyboard) return;
|
|
2089
2151
|
clearTimeout(problemTimer);
|
|
2090
2152
|
problemTimer = window.setTimeout(closeProblems, 250);
|
|
@@ -3026,6 +3088,12 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
3026
3088
|
], apple));
|
|
3027
3089
|
/** After Escape, Tab leaves the editor instead of indenting, so keyboard users are never stuck. */
|
|
3028
3090
|
let tabLeaves = false;
|
|
3091
|
+
const MODIFIERS = /* @__PURE__ */ new Set([
|
|
3092
|
+
"Shift",
|
|
3093
|
+
"Control",
|
|
3094
|
+
"Alt",
|
|
3095
|
+
"Meta"
|
|
3096
|
+
]);
|
|
3029
3097
|
/** When Enter last confirmed a composition; some browsers also put a line break into the textarea for it, right after. */
|
|
3030
3098
|
let confirmEnter = -Infinity;
|
|
3031
3099
|
function onKeydown(event) {
|
|
@@ -3053,7 +3121,7 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
3053
3121
|
return;
|
|
3054
3122
|
}
|
|
3055
3123
|
const leaving = tabLeaves && (name === "tab" || name === "shift+tab");
|
|
3056
|
-
tabLeaves = name === "escape";
|
|
3124
|
+
if (!MODIFIERS.has(event.key)) tabLeaves = name === "escape";
|
|
3057
3125
|
if (leaving) {
|
|
3058
3126
|
const first = name === "tab" && !shownWidgets.value.length ? keysEl.value?.querySelector("button") : null;
|
|
3059
3127
|
if (first) {
|
|
@@ -3287,6 +3355,27 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
3287
3355
|
}
|
|
3288
3356
|
/** A tap that may turn into a scroll or a long press; touches only act once they end in place. */
|
|
3289
3357
|
let touch = null;
|
|
3358
|
+
/** A finger or pen on a pressable gutter cell, which presses if it lifts in place. */
|
|
3359
|
+
let cellTap = null;
|
|
3360
|
+
/**
|
|
3361
|
+
* A tap on a gutter cell lifted in place. A marker still out of sight (shown
|
|
3362
|
+
* on hover, which a finger can't do) isn't pressed yet: the cursor moves to
|
|
3363
|
+
* its line, which shows it, and the next tap presses it.
|
|
3364
|
+
*/
|
|
3365
|
+
function endCellTap(event) {
|
|
3366
|
+
const tap = cellTap;
|
|
3367
|
+
cellTap = null;
|
|
3368
|
+
if (!tap) return;
|
|
3369
|
+
const column = gutterColumns.value[tap.column];
|
|
3370
|
+
if (!column?.onPress || props.disabled) return;
|
|
3371
|
+
if ((gutterMarkers.value[tap.column]?.get(tap.line))?.visible === "hover" && !(focused.value && activeLineNumber.value === tap.line)) {
|
|
3372
|
+
touchUi.value = true;
|
|
3373
|
+
select("char", doc.value.line(tap.line).from, false);
|
|
3374
|
+
focusInput();
|
|
3375
|
+
return;
|
|
3376
|
+
}
|
|
3377
|
+
column.onPress(tap.line, event);
|
|
3378
|
+
}
|
|
3290
3379
|
/** The fold toggle or folded marker under a pointer, as the line it belongs to. */
|
|
3291
3380
|
function foldTarget(event) {
|
|
3292
3381
|
const el = event.target?.closest?.("[data-fold], [data-unfold]");
|
|
@@ -3303,11 +3392,24 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
3303
3392
|
function onPointerDown(event, area) {
|
|
3304
3393
|
if (event.button !== 0 || props.disabled) return;
|
|
3305
3394
|
const cell = event.target?.closest?.("[data-gutter-cell]");
|
|
3306
|
-
const
|
|
3395
|
+
const c = Number(cell?.getAttribute("data-gutter-cell"));
|
|
3396
|
+
const column = cell && gutterColumns.value[c];
|
|
3307
3397
|
if (column?.onPress) {
|
|
3308
3398
|
event.preventDefault();
|
|
3309
3399
|
event.stopPropagation();
|
|
3310
|
-
|
|
3400
|
+
const line = Number(cell.getAttribute("data-line"));
|
|
3401
|
+
if (event.pointerType === "touch" || event.pointerType === "pen") {
|
|
3402
|
+
onPointerCancel();
|
|
3403
|
+
cellTap = {
|
|
3404
|
+
x: event.clientX,
|
|
3405
|
+
y: event.clientY,
|
|
3406
|
+
pointer: event.pointerId,
|
|
3407
|
+
column: c,
|
|
3408
|
+
line
|
|
3409
|
+
};
|
|
3410
|
+
return;
|
|
3411
|
+
}
|
|
3412
|
+
column.onPress(line, event);
|
|
3311
3413
|
return;
|
|
3312
3414
|
}
|
|
3313
3415
|
const fold = foldTarget(event);
|
|
@@ -3400,10 +3502,15 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
3400
3502
|
return count;
|
|
3401
3503
|
}
|
|
3402
3504
|
function onPointerMove(event) {
|
|
3505
|
+
if (cellTap && event.pointerId === cellTap.pointer) {
|
|
3506
|
+
if (Math.hypot(event.clientX - cellTap.x, event.clientY - cellTap.y) > 8) cellTap = null;
|
|
3507
|
+
return;
|
|
3508
|
+
}
|
|
3403
3509
|
if (!touch || event.pointerId !== touch.pointer) return;
|
|
3404
3510
|
if (Math.hypot(event.clientX - touch.x, event.clientY - touch.y) > 8) onPointerCancel();
|
|
3405
3511
|
}
|
|
3406
3512
|
function onPointerUp(event, area) {
|
|
3513
|
+
if (cellTap && event.pointerId === cellTap.pointer) return endCellTap(event);
|
|
3407
3514
|
if (!touch || event.pointerId !== touch.pointer) return;
|
|
3408
3515
|
onPointerCancel();
|
|
3409
3516
|
const iconLine = area === "gutter" ? problemIconLine(event) : null;
|
|
@@ -3424,6 +3531,7 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
3424
3531
|
focusInput();
|
|
3425
3532
|
}
|
|
3426
3533
|
function onPointerCancel() {
|
|
3534
|
+
cellTap = null;
|
|
3427
3535
|
if (touch) {
|
|
3428
3536
|
clearTimeout(touch.timer);
|
|
3429
3537
|
touch.hold.release();
|
|
@@ -4450,6 +4558,7 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
4450
4558
|
};
|
|
4451
4559
|
context = api;
|
|
4452
4560
|
provide(CODE_EDITOR_KEY, api);
|
|
4561
|
+
provide(WIDGET_HEIGHT_KEY, null);
|
|
4453
4562
|
__expose(api);
|
|
4454
4563
|
return (_ctx, _cache) => {
|
|
4455
4564
|
return openBlock(), createElementBlock("div", {
|
|
@@ -4461,7 +4570,8 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
4461
4570
|
unref(ns).is("readonly", !!__props.readonly),
|
|
4462
4571
|
unref(ns).is("disabled", !!__props.disabled),
|
|
4463
4572
|
unref(ns).is("foldable", __props.foldable),
|
|
4464
|
-
unref(ns).is("wrap", __props.wrap)
|
|
4573
|
+
unref(ns).is("wrap", __props.wrap),
|
|
4574
|
+
unref(ns).is("bordered", __props.bordered)
|
|
4465
4575
|
]),
|
|
4466
4576
|
style: normalizeStyle({
|
|
4467
4577
|
"--dou-code-editor-gutter": `${gutterWidth.value}px`,
|
|
@@ -4586,7 +4696,6 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
4586
4696
|
}, [__props.gutter && (__props.lineNumbers || __props.foldable || gutterCells.value) ? (openBlock(), createElementBlock("div", {
|
|
4587
4697
|
key: 0,
|
|
4588
4698
|
class: normalizeClass(unref(ns).e("gutter")),
|
|
4589
|
-
"aria-hidden": "true",
|
|
4590
4699
|
onPointerdown: _cache[5] || (_cache[5] = ($event) => onPointerDown($event, "gutter")),
|
|
4591
4700
|
onPointermove: onPointerMove,
|
|
4592
4701
|
onPointerup: _cache[6] || (_cache[6] = ($event) => onPointerUp($event, "gutter")),
|
|
@@ -4600,7 +4709,11 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
4600
4709
|
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(rows.value, (row) => {
|
|
4601
4710
|
return openBlock(), createElementBlock("div", {
|
|
4602
4711
|
key: row.n,
|
|
4603
|
-
class: normalizeClass([
|
|
4712
|
+
class: normalizeClass([
|
|
4713
|
+
unref(ns).e("number"),
|
|
4714
|
+
unref(ns).is("active", row.n === activeLineNumber.value),
|
|
4715
|
+
unref(ns).is("hovered", row.n === hoveredLine.value)
|
|
4716
|
+
]),
|
|
4604
4717
|
style: normalizeStyle({
|
|
4605
4718
|
height: row.wrapped.breaks.length ? `${(row.wrapped.breaks.length + 1) * lineHeight.value}px` : void 0,
|
|
4606
4719
|
marginTop: gapBefore(row.n) ? `${gapBefore(row.n)}px` : void 0
|
|
@@ -4610,21 +4723,30 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
4610
4723
|
key: 0,
|
|
4611
4724
|
class: normalizeClass(unref(ns).e("cells"))
|
|
4612
4725
|
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(gutterColumns.value, (column, c) => {
|
|
4613
|
-
return openBlock(), createElementBlock("span", {
|
|
4726
|
+
return openBlock(), createElementBlock("span", mergeProps({
|
|
4614
4727
|
key: column.name,
|
|
4615
|
-
class:
|
|
4616
|
-
|
|
4728
|
+
class: [
|
|
4729
|
+
unref(ns).e("cell"),
|
|
4730
|
+
unref(ns).is("on-hover", gutterMarkers.value[c]?.get(row.n)?.visible === "hover"),
|
|
4731
|
+
gutterMarkers.value[c]?.get(row.n)?.class
|
|
4732
|
+
],
|
|
4733
|
+
style: { width: `${column.width}px` },
|
|
4617
4734
|
title: gutterMarkers.value[c]?.get(row.n)?.title,
|
|
4618
|
-
"data-gutter-cell": column.onPress ? c : void 0,
|
|
4735
|
+
"data-gutter-cell": column.onPress && (column.pressOn !== "markers" || gutterMarkers.value[c]?.has(row.n)) ? c : void 0,
|
|
4619
4736
|
"data-line": row.n
|
|
4620
|
-
},
|
|
4737
|
+
}, { ref_for: true }, column.onPress && gutterMarkers.value[c]?.get(row.n) && !__props.disabled ? {
|
|
4738
|
+
role: "button",
|
|
4739
|
+
tabindex: row.n === activeLineNumber.value ? 0 : -1,
|
|
4740
|
+
"aria-label": gutterMarkers.value[c].get(row.n).title
|
|
4741
|
+
} : { "aria-hidden": "true" }, { onKeydown: ($event) => onCellKeydown($event, c, row.n) }), [gutterMarkers.value[c]?.get(row.n) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [gutterMarkers.value[c].get(row.n).icon ? (openBlock(), createBlock(resolveDynamicComponent(gutterMarkers.value[c].get(row.n).icon), { key: 0 })) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(gutterMarkers.value[c].get(row.n).text), 1)], 64))], 64)) : createCommentVNode("", true)], 16, _hoisted_1);
|
|
4621
4742
|
}), 128))], 2)) : createCommentVNode("", true),
|
|
4622
|
-
__props.lineNumbers ? (openBlock(), createElementBlock(
|
|
4743
|
+
__props.lineNumbers ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(row.n), 1)) : createCommentVNode("", true),
|
|
4623
4744
|
__props.foldable && (row.folded || foldableLines.value.has(row.n)) ? (openBlock(), createElementBlock("span", {
|
|
4624
4745
|
key: 2,
|
|
4625
4746
|
class: normalizeClass([unref(ns).e("fold-toggle"), unref(ns).is("folded", row.folded)]),
|
|
4626
|
-
"data-fold": row.n
|
|
4627
|
-
|
|
4747
|
+
"data-fold": row.n,
|
|
4748
|
+
"aria-hidden": "true"
|
|
4749
|
+
}, [row.folded ? (openBlock(), createBlock(unref(ChevronRightIcon), { key: 0 })) : (openBlock(), createBlock(unref(ChevronDownIcon), { key: 1 }))], 10, _hoisted_3)) : createCommentVNode("", true)
|
|
4628
4750
|
], 6);
|
|
4629
4751
|
}), 128))], 6)], 34)) : createCommentVNode("", true), createElementVNode("div", {
|
|
4630
4752
|
ref_key: "content",
|
|
@@ -4736,13 +4858,13 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
4736
4858
|
class: normalizeClass(part[1]),
|
|
4737
4859
|
title: part[2],
|
|
4738
4860
|
style: normalizeStyle(part[4])
|
|
4739
|
-
}, toDisplayString(part[0]), 15,
|
|
4861
|
+
}, toDisplayString(part[0]), 15, _hoisted_4)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [createTextVNode(toDisplayString(part[0]), 1)], 64))], 64);
|
|
4740
4862
|
}), 128)), row.folded && sub === row.wrapped.breaks.length ? (openBlock(), createElementBlock("span", {
|
|
4741
4863
|
key: 0,
|
|
4742
4864
|
class: normalizeClass(unref(ns).e("fold-marker")),
|
|
4743
4865
|
"data-unfold": row.n,
|
|
4744
4866
|
title: unref(messages).unfold
|
|
4745
|
-
}, "⋯", 10,
|
|
4867
|
+
}, "⋯", 10, _hoisted_5)) : createCommentVNode("", true)], 6);
|
|
4746
4868
|
}), 128)) : row.tokens || row.marks || row.inlines ? (openBlock(true), createElementBlock(Fragment, { key: 2 }, renderList(partsOf(row), (part, i) => {
|
|
4747
4869
|
return openBlock(), createElementBlock(Fragment, { key: i }, [part[3] !== void 0 ? (openBlock(), createElementBlock("span", {
|
|
4748
4870
|
key: 0,
|
|
@@ -4755,13 +4877,13 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
4755
4877
|
class: normalizeClass(part[1]),
|
|
4756
4878
|
title: part[2],
|
|
4757
4879
|
style: normalizeStyle(part[4])
|
|
4758
|
-
}, toDisplayString(part[0]), 15,
|
|
4880
|
+
}, toDisplayString(part[0]), 15, _hoisted_6)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [createTextVNode(toDisplayString(part[0]), 1)], 64))], 64);
|
|
4759
4881
|
}), 128)) : (openBlock(), createElementBlock(Fragment, { key: 3 }, [createTextVNode(toDisplayString(row.text), 1)], 64)), row.folded && !row.wrapped.breaks.length ? (openBlock(), createElementBlock("span", {
|
|
4760
4882
|
key: 4,
|
|
4761
4883
|
class: normalizeClass(unref(ns).e("fold-marker")),
|
|
4762
4884
|
"data-unfold": row.n,
|
|
4763
4885
|
title: unref(messages).unfold
|
|
4764
|
-
}, "⋯", 10,
|
|
4886
|
+
}, "⋯", 10, _hoisted_7)) : createCommentVNode("", true)], 6));
|
|
4765
4887
|
_item.memo = _memo;
|
|
4766
4888
|
return _item;
|
|
4767
4889
|
}, _cache, 10), 128))], 6),
|
|
@@ -4841,9 +4963,9 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
4841
4963
|
class: normalizeClass([unref(ns).e("fix"), unref(ns).is("active", i === problemBox.value.index)]),
|
|
4842
4964
|
"aria-current": i === problemBox.value.index || void 0,
|
|
4843
4965
|
onClick: ($event) => runFix(i)
|
|
4844
|
-
}, toDisplayString(fix.action.label), 11,
|
|
4966
|
+
}, toDisplayString(fix.action.label), 11, _hoisted_9);
|
|
4845
4967
|
}), 128))], 2)) : createCommentVNode("", true)
|
|
4846
|
-
], 46,
|
|
4968
|
+
], 46, _hoisted_8)) : createCommentVNode("", true),
|
|
4847
4969
|
completionStyle.value ? (openBlock(), createElementBlock("div", {
|
|
4848
4970
|
key: 1,
|
|
4849
4971
|
ref_key: "completionEl",
|
|
@@ -4882,8 +5004,8 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
4882
5004
|
key: 0,
|
|
4883
5005
|
class: normalizeClass(unref(ns).e("completion-detail"))
|
|
4884
5006
|
}, toDisplayString(item.option.detail), 3)) : createCommentVNode("", true)
|
|
4885
|
-
], 10,
|
|
4886
|
-
}), 128))], 10,
|
|
5007
|
+
], 10, _hoisted_11);
|
|
5008
|
+
}), 128))], 10, _hoisted_10), completion.value.items[completion.value.index]?.option.info ? (openBlock(), createElementBlock("div", {
|
|
4887
5009
|
key: 0,
|
|
4888
5010
|
class: normalizeClass(unref(ns).e("completion-info"))
|
|
4889
5011
|
}, [typeof completion.value.items[completion.value.index].option.info === "string" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(toDisplayString(completion.value.items[completion.value.index].option.info), 1)], 64)) : (openBlock(), createBlock(unref(render_part_default), {
|
|
@@ -4910,7 +5032,7 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
4910
5032
|
}, [typeof signature.value.result.info === "string" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(toDisplayString(signature.value.result.info), 1)], 64)) : (openBlock(), createBlock(unref(render_part_default), {
|
|
4911
5033
|
key: 1,
|
|
4912
5034
|
render: signature.value.result.info
|
|
4913
|
-
}, null, 8, ["render"]))], 2)) : createCommentVNode("", true)], 46,
|
|
5035
|
+
}, null, 8, ["render"]))], 2)) : createCommentVNode("", true)], 46, _hoisted_12)) : createCommentVNode("", true),
|
|
4914
5036
|
(openBlock(true), createElementBlock(Fragment, null, renderList(handles.value, (handle) => {
|
|
4915
5037
|
return openBlock(), createElementBlock("div", {
|
|
4916
5038
|
key: handle.kind,
|
|
@@ -4918,7 +5040,7 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
4918
5040
|
style: normalizeStyle({ transform: `translate(${handle.left}px, ${handle.top}px)` }),
|
|
4919
5041
|
"aria-hidden": "true",
|
|
4920
5042
|
onPointerdown: ($event) => onHandleDown($event, handle.kind)
|
|
4921
|
-
}, null, 46,
|
|
5043
|
+
}, null, 46, _hoisted_13);
|
|
4922
5044
|
}), 128)),
|
|
4923
5045
|
magnifier.value ? (openBlock(), createElementBlock("div", {
|
|
4924
5046
|
key: 3,
|
|
@@ -4938,7 +5060,7 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
4938
5060
|
class: normalizeClass(part[1]),
|
|
4939
5061
|
title: part[2],
|
|
4940
5062
|
style: normalizeStyle(part[4])
|
|
4941
|
-
}, toDisplayString(part[0]), 15,
|
|
5063
|
+
}, toDisplayString(part[0]), 15, _hoisted_14)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [createTextVNode(toDisplayString(part[0]), 1)], 64))], 64);
|
|
4942
5064
|
}), 128))], 6), createElementVNode("div", {
|
|
4943
5065
|
class: normalizeClass(unref(ns).e("magnifier-caret")),
|
|
4944
5066
|
style: normalizeStyle({ left: `${magnifier.value.caret - 1}px` })
|
|
@@ -4959,8 +5081,8 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
4959
5081
|
tabindex: "-1",
|
|
4960
5082
|
class: normalizeClass(unref(ns).e("menu-button")),
|
|
4961
5083
|
onClick: ($event) => item.run()
|
|
4962
|
-
}, toDisplayString(item.label), 11,
|
|
4963
|
-
}), 128))], 46,
|
|
5084
|
+
}, toDisplayString(item.label), 11, _hoisted_16);
|
|
5085
|
+
}), 128))], 46, _hoisted_15)) : createCommentVNode("", true)
|
|
4964
5086
|
], 6)], 8, ["to", "disabled"])),
|
|
4965
5087
|
createElementVNode("textarea", {
|
|
4966
5088
|
ref_key: "input",
|
|
@@ -4993,7 +5115,7 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
4993
5115
|
onPaste,
|
|
4994
5116
|
onFocus,
|
|
4995
5117
|
onBlur
|
|
4996
|
-
}, null, 46,
|
|
5118
|
+
}, null, 46, _hoisted_17),
|
|
4997
5119
|
shownWidgets.value.length ? (openBlock(), createElementBlock("div", {
|
|
4998
5120
|
key: 3,
|
|
4999
5121
|
class: normalizeClass(unref(ns).e("widgets")),
|
|
@@ -5012,7 +5134,7 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
5012
5134
|
transform: `translate(${scrollLeft.value}px, ${widget.top}px)`,
|
|
5013
5135
|
width: `${Math.max(0, viewWidth.value - gutterWidth.value)}px`
|
|
5014
5136
|
})
|
|
5015
|
-
}, [createVNode(unref(render_part_default), { render: widget.render }, null, 8, ["render"])], 14,
|
|
5137
|
+
}, [createVNode(unref(render_part_default), { render: widget.render }, null, 8, ["render"])], 14, _hoisted_18);
|
|
5016
5138
|
}), 128))], 34)) : createCommentVNode("", true)
|
|
5017
5139
|
], 34)], 6)], 34), minimapOn.value && minimap.value ? (openBlock(), createElementBlock("div", {
|
|
5018
5140
|
key: 0,
|
|
@@ -5064,7 +5186,7 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
5064
5186
|
onPointerdown: onKeysGripDown,
|
|
5065
5187
|
onKeydown: onKeysGripKey,
|
|
5066
5188
|
onMousedown: _cache[25] || (_cache[25] = withModifiers(() => {}, ["prevent"]))
|
|
5067
|
-
}, [createVNode(unref(GripVerticalIcon))], 42,
|
|
5189
|
+
}, [createVNode(unref(GripVerticalIcon))], 42, _hoisted_19), createVNode(code_keys_default, {
|
|
5068
5190
|
editor: keysEditor,
|
|
5069
5191
|
keys: keysList.value,
|
|
5070
5192
|
messages: unref(messages)
|