@dou-ui/code 0.1.0-alpha.23 → 0.1.0-alpha.25
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/assets/default-BWWFJmzn.js.map +1 -0
- package/dist/code-diff.js.map +1 -1
- package/dist/code-diff.vue_vue_type_script_setup_true_lang.js +196 -18
- 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 +636 -461
- package/dist/code-editor.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/extension.js.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/language/highlighter.js +1 -1
- package/dist/language/highlighter.js.map +1 -1
- package/dist/language/language.js +24 -2
- package/dist/language/language.js.map +1 -1
- package/dist/language/remote-tokens.js +131 -0
- package/dist/language/remote-tokens.js.map +1 -0
- package/dist/language/worker-client.js +308 -33
- package/dist/language/worker-client.js.map +1 -1
- package/dist/language/worker-protocol.js.map +1 -1
- package/dist/shiki/index.js +54 -3
- package/dist/shiki/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/types/code-diff.vue.d.ts +4 -1
- package/dist/types/code-editor.vue.d.ts +2 -1
- package/dist/types/extension.d.ts +13 -1
- package/dist/types/index.d.ts +18 -6
- package/dist/types/language/language.d.ts +27 -0
- package/dist/types/language/remote-tokens.d.ts +38 -0
- package/dist/types/language/worker-client.d.ts +85 -15
- package/dist/types/language/worker-protocol.d.ts +53 -2
- package/dist/types/shiki/index.d.ts +36 -1
- package/dist/types/types.d.ts +43 -8
- package/dist/types/view/measure.d.ts +6 -0
- package/dist/types/worker/index.d.ts +27 -12
- package/dist/view/measure.js +23 -5
- package/dist/view/measure.js.map +1 -1
- package/dist/worker/default.js +1 -1
- package/dist/worker/index.js +280 -53
- package/dist/worker/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/assets/default-BZBMZKf_.js.map +0 -1
|
@@ -11,7 +11,8 @@ import { CodeTransaction } from "./core/transaction.js";
|
|
|
11
11
|
import { matchAfter, replacementFor, searchText } from "./core/search.js";
|
|
12
12
|
import { lineParts, tokenTypes } from "./language/language.js";
|
|
13
13
|
import { CodeHighlighter } from "./language/highlighter.js";
|
|
14
|
-
import {
|
|
14
|
+
import { RemoteTokenStore, compressLineRanges } from "./language/remote-tokens.js";
|
|
15
|
+
import { SyntaxWorkerClient, acquirePoolWorker, holdWorker, isCodeWorkerPool, ownWorker } from "./language/worker-client.js";
|
|
15
16
|
import { format, useCodeMessages } from "./locale.js";
|
|
16
17
|
import { visibleViewport } from "./view/viewport.js";
|
|
17
18
|
import code_keys_default from "./code-keys2.js";
|
|
@@ -37,24 +38,30 @@ var _hoisted_2 = {
|
|
|
37
38
|
"aria-hidden": "true"
|
|
38
39
|
};
|
|
39
40
|
var _hoisted_3 = ["data-fold"];
|
|
40
|
-
var _hoisted_4 = [
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
var
|
|
47
|
-
var
|
|
41
|
+
var _hoisted_4 = [
|
|
42
|
+
"title",
|
|
43
|
+
"data-gutter-cell",
|
|
44
|
+
"data-line",
|
|
45
|
+
"onKeydown"
|
|
46
|
+
];
|
|
47
|
+
var _hoisted_5 = ["title"];
|
|
48
|
+
var _hoisted_6 = ["data-unfold", "title"];
|
|
49
|
+
var _hoisted_7 = ["title"];
|
|
50
|
+
var _hoisted_8 = ["data-unfold", "title"];
|
|
51
|
+
var _hoisted_9 = ["aria-label"];
|
|
52
|
+
var _hoisted_10 = ["aria-current", "onClick"];
|
|
53
|
+
var _hoisted_11 = ["aria-label"];
|
|
54
|
+
var _hoisted_12 = [
|
|
48
55
|
"id",
|
|
49
56
|
"aria-selected",
|
|
50
57
|
"onClick"
|
|
51
58
|
];
|
|
52
|
-
var
|
|
53
|
-
var
|
|
54
|
-
var
|
|
55
|
-
var
|
|
56
|
-
var
|
|
57
|
-
var
|
|
59
|
+
var _hoisted_13 = ["aria-label"];
|
|
60
|
+
var _hoisted_14 = ["onPointerdown"];
|
|
61
|
+
var _hoisted_15 = ["title"];
|
|
62
|
+
var _hoisted_16 = ["aria-label"];
|
|
63
|
+
var _hoisted_17 = ["onClick"];
|
|
64
|
+
var _hoisted_18 = [
|
|
58
65
|
"aria-label",
|
|
59
66
|
"aria-placeholder",
|
|
60
67
|
"aria-autocomplete",
|
|
@@ -62,8 +69,8 @@ var _hoisted_17 = [
|
|
|
62
69
|
"readonly",
|
|
63
70
|
"disabled"
|
|
64
71
|
];
|
|
65
|
-
var
|
|
66
|
-
var
|
|
72
|
+
var _hoisted_19 = ["role", "aria-label"];
|
|
73
|
+
var _hoisted_20 = ["aria-label", "title"];
|
|
67
74
|
var MAX_HEIGHT = 8e6;
|
|
68
75
|
var OVERSCAN = 6;
|
|
69
76
|
/** The textarea mirrors at most this much text around the cursor. */
|
|
@@ -118,9 +125,14 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
118
125
|
placeholder: {},
|
|
119
126
|
language: { default: void 0 },
|
|
120
127
|
worker: {
|
|
121
|
-
type: [
|
|
128
|
+
type: [
|
|
129
|
+
Boolean,
|
|
130
|
+
Function,
|
|
131
|
+
Object
|
|
132
|
+
],
|
|
122
133
|
default: false
|
|
123
134
|
},
|
|
135
|
+
syncHighlightLines: { default: void 0 },
|
|
124
136
|
closeBrackets: {
|
|
125
137
|
type: Boolean,
|
|
126
138
|
default: true
|
|
@@ -178,10 +190,12 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
178
190
|
const emit = __emit;
|
|
179
191
|
const ns = useNamespace("code-editor");
|
|
180
192
|
const instance = getCurrentInstance();
|
|
181
|
-
/** Space above the first line and below the last,
|
|
193
|
+
/** Space above the first line and below the last, before and after each line, and around line numbers; set from the styles once measured. */
|
|
182
194
|
const pad = reactive({
|
|
183
195
|
x: 12,
|
|
184
|
-
y: 8
|
|
196
|
+
y: 8,
|
|
197
|
+
gutterLeft: 16,
|
|
198
|
+
gutterRight: 12
|
|
185
199
|
});
|
|
186
200
|
/** Browsers stop growing an element somewhere past 16M px; taller texts scroll in scaled steps. */
|
|
187
201
|
const apple = isApplePlatform();
|
|
@@ -577,6 +591,7 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
577
591
|
above,
|
|
578
592
|
render: widget.render,
|
|
579
593
|
label: widget.label,
|
|
594
|
+
fullWidth: !!widget.fullWidth,
|
|
580
595
|
row: drawn.rowOf(n) + (above ? 0 : drawn.rowsOf(n)),
|
|
581
596
|
height: widgetHeights.get(key) ?? widget.height ?? lh,
|
|
582
597
|
before: 0
|
|
@@ -806,18 +821,28 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
806
821
|
if (props.diagnostics !== void 0 || linting.value || diagnostics.value.length) columns.push({
|
|
807
822
|
name: "problems",
|
|
808
823
|
width: 16,
|
|
824
|
+
overlay: false,
|
|
809
825
|
markers: problemMarkers
|
|
810
826
|
});
|
|
811
827
|
for (const extension of extensions.value) for (const gutter of extension.gutters ?? []) columns.push({
|
|
812
828
|
name: gutter.name,
|
|
813
|
-
width: gutter.width ?? 16,
|
|
829
|
+
width: gutter.width ?? (gutter.overlay ? 18 : 16),
|
|
830
|
+
overlay: !!gutter.overlay,
|
|
814
831
|
markers: () => withHoverMarker(gutter.markers?.(context) ?? [], gutter.hoverMarker),
|
|
815
832
|
onPress: gutter.onPress && ((line, event) => gutter.onPress(line, event, context)),
|
|
816
833
|
pressOn: gutter.pressOn
|
|
817
834
|
});
|
|
818
835
|
return columns;
|
|
819
836
|
});
|
|
820
|
-
const
|
|
837
|
+
const flowGutterColumns = computed(() => gutterColumns.value.map((column, index) => ({
|
|
838
|
+
column,
|
|
839
|
+
index
|
|
840
|
+
})).filter((item) => !item.column.overlay));
|
|
841
|
+
const overlayGutterColumns = computed(() => gutterColumns.value.map((column, index) => ({
|
|
842
|
+
column,
|
|
843
|
+
index
|
|
844
|
+
})).filter((item) => item.column.overlay));
|
|
845
|
+
const gutterCells = computed(() => flowGutterColumns.value.reduce((sum, item) => sum + item.column.width, 0));
|
|
821
846
|
/** A column's markers, and its `hoverMarker` on the other lines in view. */
|
|
822
847
|
function withHoverMarker(own, hover) {
|
|
823
848
|
if (!hover) return own;
|
|
@@ -897,7 +922,7 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
897
922
|
if (!props.gutter || !props.lineNumbers && !props.foldable && !cells) return 0;
|
|
898
923
|
metrics.value;
|
|
899
924
|
const digits = Math.max(2, String(doc.value.lines).length);
|
|
900
|
-
return cells + (props.lineNumbers ? Math.ceil(digits * measure.cell) +
|
|
925
|
+
return cells + (props.lineNumbers ? Math.ceil(digits * measure.cell) + pad.gutterLeft + pad.gutterRight : props.foldable ? 12 : 0) + (props.foldable ? 14 : 0);
|
|
901
926
|
});
|
|
902
927
|
const contentWidth = computed(() => {
|
|
903
928
|
if (props.wrap) return 0;
|
|
@@ -940,11 +965,12 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
940
965
|
const lineOf = texts ? (k) => texts[k - 1] : void 0;
|
|
941
966
|
return (n) => {
|
|
942
967
|
const read = !!hl?.ready(n);
|
|
968
|
+
const hasTokens = read || usesRemoteTokens() && !!remoteTokens.line(n);
|
|
943
969
|
const language = outer ? (read ? hl.languageAt(n) : null) ?? outer : null;
|
|
944
970
|
return foldEndAt(text, n, {
|
|
945
971
|
brackets: language?.brackets,
|
|
946
972
|
tabSize,
|
|
947
|
-
skip:
|
|
973
|
+
skip: hasTokens ? inStringOrComment : void 0,
|
|
948
974
|
lineText: lineOf
|
|
949
975
|
});
|
|
950
976
|
};
|
|
@@ -1127,7 +1153,7 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
1127
1153
|
const { numbers, texts } = shownLines.value;
|
|
1128
1154
|
const p = preview.value;
|
|
1129
1155
|
const line = p ? doc.value.lineAt(p.from) : null;
|
|
1130
|
-
const tokensOf = syntaxLines(visibleFrom.value, visibleTo.value);
|
|
1156
|
+
const tokensOf = syntaxLines(visibleFrom.value, visibleTo.value, numbers);
|
|
1131
1157
|
const starts = new Set(foldHidden.value.map(([from]) => from - 1));
|
|
1132
1158
|
const { marks, lineClasses, inlines } = lineDecorations.value;
|
|
1133
1159
|
return texts.map((text, i) => {
|
|
@@ -1317,17 +1343,48 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
1317
1343
|
}
|
|
1318
1344
|
/** Lines read ahead of the last read one while drawing; further away, idle time catches up first. */
|
|
1319
1345
|
let highlighter = null;
|
|
1320
|
-
|
|
1346
|
+
const remoteTokens = markRaw(new RemoteTokenStore());
|
|
1347
|
+
/** Bumped when lines in view got their tokens asynchronously (idle time or worker). */
|
|
1321
1348
|
const syntaxTick = ref(0);
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
}
|
|
1349
|
+
const syncReach = () => {
|
|
1350
|
+
const configured = props.syncHighlightLines;
|
|
1351
|
+
return configured === void 0 ? SYNTAX_REACH : Math.max(0, configured);
|
|
1352
|
+
};
|
|
1353
|
+
/** Whether the editor is currently intersecting the viewport (plus prewarm margin). */
|
|
1354
|
+
let inViewport = true;
|
|
1355
|
+
let viewportObserver;
|
|
1326
1356
|
/** The worker reading ahead, with `worker`, and how to let go of it. */
|
|
1327
1357
|
let syntaxWorker = null;
|
|
1328
1358
|
let releaseWorker = null;
|
|
1329
1359
|
let workerJob = 0;
|
|
1360
|
+
let workerAcquiring = false;
|
|
1361
|
+
let workerFallenBack = false;
|
|
1362
|
+
/** True once the worker has responded in flat per-line `tokens` mode for the current language. */
|
|
1363
|
+
let workerTokenMode = false;
|
|
1364
|
+
const workerConfigured = () => !!props.language && !!props.worker && !workerFallenBack && typeof Worker !== "undefined";
|
|
1365
|
+
const usesRemoteTokens = () => workerTokenMode || props.language?.workerMode === "tokens" && workerConfigured();
|
|
1366
|
+
let syntaxJob = 0;
|
|
1367
|
+
let syntaxUntil = 0;
|
|
1368
|
+
/** Runs `task` when the page is idle, with how long it may take (ms). */
|
|
1369
|
+
const idle = typeof requestIdleCallback === "function" ? (task) => requestIdleCallback((deadline) => task(deadline.timeRemaining()), { timeout: 100 }) : (task) => window.setTimeout(() => task(8), 16);
|
|
1370
|
+
const cancelIdle = (id) => typeof cancelIdleCallback === "function" ? cancelIdleCallback(id) : clearTimeout(id);
|
|
1371
|
+
function cancelScheduledSyntax() {
|
|
1372
|
+
if (syntaxJob) {
|
|
1373
|
+
cancelIdle(syntaxJob);
|
|
1374
|
+
syntaxJob = 0;
|
|
1375
|
+
}
|
|
1376
|
+
syntaxUntil = 0;
|
|
1377
|
+
}
|
|
1378
|
+
watch(() => props.language, (language) => {
|
|
1379
|
+
cancelScheduledSyntax();
|
|
1380
|
+
remoteTokens.clear();
|
|
1381
|
+
workerTokenMode = false;
|
|
1382
|
+
workerFallenBack = false;
|
|
1383
|
+
highlighter = language ? markRaw(new CodeHighlighter(language, doc.value, props.tabSize)) : null;
|
|
1384
|
+
syntaxTick.value++;
|
|
1385
|
+
}, { immediate: true });
|
|
1330
1386
|
function stopSyntaxWorker() {
|
|
1387
|
+
workerAcquiring = false;
|
|
1331
1388
|
syntaxWorker?.dispose();
|
|
1332
1389
|
syntaxWorker = null;
|
|
1333
1390
|
releaseWorker?.();
|
|
@@ -1335,13 +1392,21 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
1335
1392
|
}
|
|
1336
1393
|
/** Reading goes back to the page, saying why while developing. */
|
|
1337
1394
|
function workerFallback(message, error) {
|
|
1395
|
+
workerFallenBack = true;
|
|
1396
|
+
workerTokenMode = false;
|
|
1338
1397
|
stopSyntaxWorker();
|
|
1339
1398
|
syntaxTick.value++;
|
|
1340
1399
|
if (process.env.NODE_ENV !== "production") console.warn(`[@dou-ui/code] ${message}: colors are read on the page instead.`, ...error ? [error] : []);
|
|
1341
1400
|
}
|
|
1342
|
-
function attachWorker(worker, release) {
|
|
1401
|
+
function attachWorker(worker, release, setBusy) {
|
|
1343
1402
|
const language = props.language;
|
|
1403
|
+
if (!language) {
|
|
1404
|
+
release();
|
|
1405
|
+
return;
|
|
1406
|
+
}
|
|
1407
|
+
cancelScheduledSyntax();
|
|
1344
1408
|
releaseWorker = release;
|
|
1409
|
+
workerTokenMode = language.workerMode === "tokens";
|
|
1345
1410
|
syntaxWorker = new SyntaxWorkerClient(worker, language, () => doc.value, props.tabSize, {
|
|
1346
1411
|
states(points) {
|
|
1347
1412
|
const hl = highlighter;
|
|
@@ -1349,35 +1414,63 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
1349
1414
|
hl.adopt(points);
|
|
1350
1415
|
syntaxTick.value++;
|
|
1351
1416
|
},
|
|
1417
|
+
tokens(from, tokenLines, frontier, ranges) {
|
|
1418
|
+
if (props.language !== language) return;
|
|
1419
|
+
workerTokenMode = true;
|
|
1420
|
+
if (ranges) remoteTokens.adoptRanges(ranges, frontier);
|
|
1421
|
+
else remoteTokens.adopt(from, tokenLines, frontier);
|
|
1422
|
+
syntaxTick.value++;
|
|
1423
|
+
},
|
|
1352
1424
|
unsupported(missing) {
|
|
1353
|
-
workerFallback(missing ? `the worker has no language named "${missing}" (for "${language.name}"); pass it to serveCodeHighlighting in the worker` : `the
|
|
1425
|
+
workerFallback(missing ? `the worker has no language named "${missing}" (for "${language.name}"); pass it to serveCodeHighlighting in the worker` : `the worker could not highlight "${language.name}"`);
|
|
1354
1426
|
},
|
|
1355
1427
|
failed(error) {
|
|
1356
1428
|
workerFallback("the highlighting worker failed", error);
|
|
1357
|
-
}
|
|
1429
|
+
},
|
|
1430
|
+
onBusyChange: setBusy
|
|
1358
1431
|
});
|
|
1359
1432
|
syntaxTick.value++;
|
|
1360
1433
|
}
|
|
1434
|
+
/** Lazily acquires a worker from the built-in or user-supplied pool when highlighting is actually needed. */
|
|
1435
|
+
function ensureWorkerClient() {
|
|
1436
|
+
if (syntaxWorker || workerAcquiring || !mounted.value || !workerConfigured()) return;
|
|
1437
|
+
const option = props.worker;
|
|
1438
|
+
if (option !== true && !isCodeWorkerPool(option)) return;
|
|
1439
|
+
const job = workerJob;
|
|
1440
|
+
workerAcquiring = true;
|
|
1441
|
+
(option === true ? ownWorker() : acquirePoolWorker(option)).then(({ worker, release, setBusy }) => {
|
|
1442
|
+
if (job !== workerJob) {
|
|
1443
|
+
release();
|
|
1444
|
+
return;
|
|
1445
|
+
}
|
|
1446
|
+
workerAcquiring = false;
|
|
1447
|
+
attachWorker(worker, release, setBusy);
|
|
1448
|
+
}, (error) => {
|
|
1449
|
+
if (job !== workerJob) return;
|
|
1450
|
+
workerAcquiring = false;
|
|
1451
|
+
workerFallback(option === true ? "the built-in worker could not start" : "the worker pool could not start", error);
|
|
1452
|
+
});
|
|
1453
|
+
}
|
|
1361
1454
|
watch([
|
|
1362
1455
|
() => props.language,
|
|
1363
1456
|
() => props.worker,
|
|
1364
1457
|
mounted
|
|
1365
1458
|
], ([language, option, isMounted]) => {
|
|
1366
1459
|
stopSyntaxWorker();
|
|
1460
|
+
remoteTokens.clear();
|
|
1461
|
+
workerFallenBack = false;
|
|
1462
|
+
workerTokenMode = false;
|
|
1367
1463
|
const job = ++workerJob;
|
|
1368
1464
|
if (!language || !option || !isMounted || typeof Worker === "undefined") return;
|
|
1369
|
-
if (option === true) {
|
|
1370
|
-
|
|
1371
|
-
if (job === workerJob) attachWorker(worker, release);
|
|
1372
|
-
else release();
|
|
1373
|
-
}, (error) => job === workerJob && workerFallback("the built-in worker could not start", error));
|
|
1465
|
+
if (option === true || isCodeWorkerPool(option)) {
|
|
1466
|
+
syntaxTick.value++;
|
|
1374
1467
|
return;
|
|
1375
1468
|
}
|
|
1376
1469
|
let worker;
|
|
1377
1470
|
try {
|
|
1378
1471
|
worker = option();
|
|
1379
1472
|
} catch (error) {
|
|
1380
|
-
workerFallback("the worker could not start", error);
|
|
1473
|
+
if (job === workerJob) workerFallback("the worker could not start", error);
|
|
1381
1474
|
return;
|
|
1382
1475
|
}
|
|
1383
1476
|
attachWorker(worker, holdWorker(worker));
|
|
@@ -1388,38 +1481,67 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
1388
1481
|
});
|
|
1389
1482
|
/** Brings the colors along with a change of the text. */
|
|
1390
1483
|
function syntaxChange(next, changes) {
|
|
1484
|
+
const prev = highlighter?.text ?? doc.value;
|
|
1485
|
+
remoteTokens.update(prev, next, changes);
|
|
1391
1486
|
highlighter?.update(next, changes);
|
|
1392
1487
|
syntaxWorker?.change(changes);
|
|
1393
1488
|
}
|
|
1394
|
-
/** Gets the tokens of the lines in view,
|
|
1395
|
-
function syntaxLines(from, to) {
|
|
1489
|
+
/** Gets the tokens of the lines in view, delegating unread ranges to the worker or idle slices. */
|
|
1490
|
+
function syntaxLines(from, to, shownNumbers) {
|
|
1396
1491
|
syntaxTick.value;
|
|
1397
1492
|
const hl = highlighter;
|
|
1398
1493
|
if (!hl) return () => null;
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1494
|
+
const reach = syncReach();
|
|
1495
|
+
const tokenRanges = shownNumbers ? compressLineRanges(shownNumbers) : from <= to ? [[from, to]] : [];
|
|
1496
|
+
if (usesRemoteTokens()) {
|
|
1497
|
+
const ready = shownNumbers ? remoteTokens.readyNumbers(shownNumbers) : remoteTokens.readyRange(from, to);
|
|
1498
|
+
if (inViewport && !ready && tokenRanges.length > 0) {
|
|
1499
|
+
const firstFrom = tokenRanges[0][0];
|
|
1500
|
+
const lastTo = tokenRanges[tokenRanges.length - 1][1];
|
|
1501
|
+
if (syntaxWorker) syntaxWorker.want(remoteTokens.frontier, lastTo, firstFrom, lastTo, tokenRanges);
|
|
1502
|
+
else ensureWorkerClient();
|
|
1503
|
+
}
|
|
1504
|
+
return (n) => remoteTokens.line(n);
|
|
1505
|
+
}
|
|
1506
|
+
if (!hl.ready(to) && to - hl.frontier > reach) {
|
|
1507
|
+
if (inViewport) {
|
|
1508
|
+
if (workerConfigured()) {
|
|
1509
|
+
if (syntaxWorker) syntaxWorker.want(hl.frontier, to, from, to, tokenRanges);
|
|
1510
|
+
else ensureWorkerClient();
|
|
1511
|
+
} else scheduleSyntax(to);
|
|
1512
|
+
}
|
|
1402
1513
|
return (n) => hl.ready(n) ? hl.line(n) : null;
|
|
1403
1514
|
}
|
|
1404
1515
|
return (n) => hl.line(n);
|
|
1405
1516
|
}
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1517
|
+
function setInViewport(visible) {
|
|
1518
|
+
if (inViewport === visible) return;
|
|
1519
|
+
inViewport = visible;
|
|
1520
|
+
if (!visible) {
|
|
1521
|
+
syntaxWorker?.cancel();
|
|
1522
|
+
cancelScheduledSyntax();
|
|
1523
|
+
} else syntaxTick.value++;
|
|
1524
|
+
}
|
|
1411
1525
|
function scheduleSyntax(until) {
|
|
1526
|
+
if (!inViewport || !mounted.value || typeof window === "undefined") return;
|
|
1412
1527
|
syntaxUntil = Math.max(syntaxUntil, until);
|
|
1413
1528
|
if (syntaxJob) return;
|
|
1414
1529
|
syntaxJob = idle((budget) => {
|
|
1415
1530
|
syntaxJob = 0;
|
|
1416
1531
|
const hl = highlighter;
|
|
1417
|
-
if (!hl)
|
|
1532
|
+
if (!hl || !inViewport) {
|
|
1533
|
+
syntaxUntil = 0;
|
|
1534
|
+
return;
|
|
1535
|
+
}
|
|
1536
|
+
const prevFrontier = hl.frontier;
|
|
1418
1537
|
hl.work(performance.now() + Math.min(20, Math.max(4, budget - 1)), syntaxUntil);
|
|
1419
1538
|
if (hl.ready(syntaxUntil)) {
|
|
1420
1539
|
syntaxUntil = 0;
|
|
1421
1540
|
syntaxTick.value++;
|
|
1422
|
-
} else
|
|
1541
|
+
} else {
|
|
1542
|
+
if (hl.frontier > prevFrontier && hl.frontier >= visibleFrom.value) syntaxTick.value++;
|
|
1543
|
+
scheduleSyntax(syntaxUntil);
|
|
1544
|
+
}
|
|
1423
1545
|
});
|
|
1424
1546
|
}
|
|
1425
1547
|
/** The kind of token the character at `pos` is part of, when its line has been read. */
|
|
@@ -1427,7 +1549,7 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
1427
1549
|
const hl = highlighter;
|
|
1428
1550
|
if (!hl || pos < 0 || pos >= doc.value.length) return null;
|
|
1429
1551
|
const line = doc.value.lineAt(pos);
|
|
1430
|
-
const tokens = hl.line(line.number,
|
|
1552
|
+
const tokens = usesRemoteTokens() ? remoteTokens.line(line.number) : hl.line(line.number, syncReach());
|
|
1431
1553
|
if (!tokens) return null;
|
|
1432
1554
|
const col = pos - line.from;
|
|
1433
1555
|
for (let i = 0; i < tokens.length; i += 2) if (col < tokens[i]) {
|
|
@@ -1439,8 +1561,9 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
1439
1561
|
function languageAt(pos) {
|
|
1440
1562
|
const hl = highlighter;
|
|
1441
1563
|
if (!hl) return null;
|
|
1564
|
+
if (usesRemoteTokens()) return hl.language;
|
|
1442
1565
|
const line = doc.value.lineAt(Math.min(Math.max(pos, 0), doc.value.length));
|
|
1443
|
-
if (line.number - hl.frontier >
|
|
1566
|
+
if (line.number - hl.frontier > syncReach()) return hl.language;
|
|
1444
1567
|
return hl.languageAt(line.number);
|
|
1445
1568
|
}
|
|
1446
1569
|
/**
|
|
@@ -4224,7 +4347,7 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
4224
4347
|
const { n, sub } = lay.lineAtRow(row);
|
|
4225
4348
|
const rowText = text.lineText(n);
|
|
4226
4349
|
const breaks = wrapRows ? wrapOf(rowText).breaks : [];
|
|
4227
|
-
const tokens = hl && (hl.ready(n) || n - hl.frontier <=
|
|
4350
|
+
const tokens = usesRemoteTokens() ? remoteTokens.line(n) : hl && (hl.ready(n) || n - hl.frontier <= syncReach()) ? hl.line(n) : null;
|
|
4228
4351
|
const rowsHere = lay.rowsOf(n);
|
|
4229
4352
|
for (let k = sub; k < rowsHere && row <= lastRow; k++, row++) {
|
|
4230
4353
|
const start = k ? breaks[k - 1] : 0;
|
|
@@ -4402,10 +4525,15 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
4402
4525
|
});
|
|
4403
4526
|
}
|
|
4404
4527
|
let resize;
|
|
4405
|
-
function
|
|
4406
|
-
measure.refresh(props.tabSize);
|
|
4528
|
+
function syncPadding() {
|
|
4407
4529
|
pad.y = measure.padY;
|
|
4408
4530
|
pad.x = measure.padX;
|
|
4531
|
+
pad.gutterLeft = measure.gutterPadLeft;
|
|
4532
|
+
pad.gutterRight = measure.gutterPadRight;
|
|
4533
|
+
}
|
|
4534
|
+
function refreshMetrics() {
|
|
4535
|
+
measure.refresh(props.tabSize);
|
|
4536
|
+
syncPadding();
|
|
4409
4537
|
readFrameFont();
|
|
4410
4538
|
metrics.value++;
|
|
4411
4539
|
syncInput();
|
|
@@ -4422,13 +4550,30 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
4422
4550
|
viewHeight.value = el.clientHeight;
|
|
4423
4551
|
viewWidth.value = el.clientWidth;
|
|
4424
4552
|
rootWidth.value = root.value?.clientWidth ?? 0;
|
|
4553
|
+
if (measure.refreshPadding()) {
|
|
4554
|
+
syncPadding();
|
|
4555
|
+
metrics.value++;
|
|
4556
|
+
syncInput();
|
|
4557
|
+
}
|
|
4425
4558
|
updateClip();
|
|
4426
4559
|
});
|
|
4427
4560
|
resize.observe(el);
|
|
4428
4561
|
if (root.value) resize.observe(root.value);
|
|
4429
4562
|
}
|
|
4430
4563
|
updateClip();
|
|
4564
|
+
if (root.value && typeof window !== "undefined" && typeof IntersectionObserver !== "undefined") {
|
|
4565
|
+
const rect = root.value.getBoundingClientRect();
|
|
4566
|
+
if (rect.width > 0 || rect.height > 0) {
|
|
4567
|
+
if (rect.bottom < -200 || rect.top > window.innerHeight + 200) inViewport = false;
|
|
4568
|
+
}
|
|
4569
|
+
viewportObserver = new IntersectionObserver((entries) => {
|
|
4570
|
+
const entry = entries[entries.length - 1];
|
|
4571
|
+
if (entry) setInViewport(entry.isIntersecting);
|
|
4572
|
+
}, { rootMargin: "200px 0px" });
|
|
4573
|
+
viewportObserver.observe(root.value);
|
|
4574
|
+
}
|
|
4431
4575
|
mounted.value = true;
|
|
4576
|
+
if (highlighter && !highlighter.ready(doc.value.lines)) syntaxTick.value++;
|
|
4432
4577
|
window.addEventListener("scroll", onWindowScroll, {
|
|
4433
4578
|
capture: true,
|
|
4434
4579
|
passive: true
|
|
@@ -4471,7 +4616,9 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
4471
4616
|
if (restarted) warnRestarts();
|
|
4472
4617
|
});
|
|
4473
4618
|
onBeforeUnmount(() => {
|
|
4474
|
-
|
|
4619
|
+
cancelScheduledSyntax();
|
|
4620
|
+
viewportObserver?.disconnect();
|
|
4621
|
+
viewportObserver = void 0;
|
|
4475
4622
|
clearTimeout(searchTimer);
|
|
4476
4623
|
resize?.disconnect();
|
|
4477
4624
|
widgetObserver?.disconnect();
|
|
@@ -4586,6 +4733,8 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
4586
4733
|
unref(ns).is("focused", focused.value),
|
|
4587
4734
|
unref(ns).is("readonly", !!__props.readonly),
|
|
4588
4735
|
unref(ns).is("disabled", !!__props.disabled),
|
|
4736
|
+
unref(ns).is("line-numbers", __props.lineNumbers),
|
|
4737
|
+
unref(ns).is("gutter-empty", !gutterWidth.value),
|
|
4589
4738
|
unref(ns).is("foldable", __props.foldable),
|
|
4590
4739
|
unref(ns).is("wrap", __props.wrap),
|
|
4591
4740
|
unref(ns).is("bordered", __props.bordered),
|
|
@@ -4594,6 +4743,8 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
4594
4743
|
style: normalizeStyle({
|
|
4595
4744
|
"--dou-code-editor-gutter": `${gutterWidth.value}px`,
|
|
4596
4745
|
"--dou-code-editor-gutter-cells": `${gutterCells.value}px`,
|
|
4746
|
+
"--dou-code-editor-view-width": viewWidth.value > 0 ? `${viewWidth.value}px` : void 0,
|
|
4747
|
+
"--dou-code-editor-widget-width": viewWidth.value > 0 ? `${Math.max(0, viewWidth.value - gutterWidth.value)}px` : void 0,
|
|
4597
4748
|
"--dou-code-editor-tab-size": __props.tabSize
|
|
4598
4749
|
})
|
|
4599
4750
|
}, [
|
|
@@ -4711,160 +4862,203 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
4711
4862
|
height: `${sizerHeight.value}px`,
|
|
4712
4863
|
minWidth: `max(100%, ${contentWidth.value + gutterWidth.value}px)`
|
|
4713
4864
|
})
|
|
4714
|
-
}, [__props.gutter && (__props.lineNumbers || __props.foldable || gutterCells.value) ? (openBlock(), createElementBlock("div", {
|
|
4715
|
-
key: 0,
|
|
4716
|
-
class: normalizeClass(unref(ns).e("gutter")),
|
|
4717
|
-
onPointerdown: _cache[5] || (_cache[5] = ($event) => onPointerDown($event, "gutter")),
|
|
4718
|
-
onPointermove: onPointerMove,
|
|
4719
|
-
onPointerup: _cache[6] || (_cache[6] = ($event) => onPointerUp($event, "gutter")),
|
|
4720
|
-
onPointercancel: onPointerCancel,
|
|
4721
|
-
onPointerenter: _cache[7] || (_cache[7] = ($event) => gutterHover.value = true),
|
|
4722
|
-
onPointerleave: _cache[8] || (_cache[8] = ($event) => gutterHover.value = false),
|
|
4723
|
-
onMousedown: _cache[9] || (_cache[9] = withModifiers(() => {}, ["prevent"]))
|
|
4724
|
-
}, [createElementVNode("div", {
|
|
4725
|
-
class: normalizeClass(unref(ns).e("numbers")),
|
|
4726
|
-
style: normalizeStyle({ transform: `translateY(${yOf(visibleFrom.value)}px)` })
|
|
4727
|
-
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(rows.value, (row) => {
|
|
4728
|
-
return openBlock(), createElementBlock("div", {
|
|
4729
|
-
key: row.n,
|
|
4730
|
-
class: normalizeClass([
|
|
4731
|
-
unref(ns).e("number"),
|
|
4732
|
-
unref(ns).is("active", row.n === activeLineNumber.value),
|
|
4733
|
-
unref(ns).is("hovered", row.n === hoveredLine.value)
|
|
4734
|
-
]),
|
|
4735
|
-
style: normalizeStyle({
|
|
4736
|
-
height: row.wrapped.breaks.length ? `${(row.wrapped.breaks.length + 1) * lineHeight.value}px` : void 0,
|
|
4737
|
-
marginTop: gapBefore(row.n) ? `${gapBefore(row.n)}px` : void 0
|
|
4738
|
-
})
|
|
4739
|
-
}, [
|
|
4740
|
-
gutterCells.value ? (openBlock(), createElementBlock("span", {
|
|
4741
|
-
key: 0,
|
|
4742
|
-
class: normalizeClass(unref(ns).e("cells"))
|
|
4743
|
-
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(gutterColumns.value, (column, c) => {
|
|
4744
|
-
return openBlock(), createElementBlock("span", mergeProps({
|
|
4745
|
-
key: column.name,
|
|
4746
|
-
class: [
|
|
4747
|
-
unref(ns).e("cell"),
|
|
4748
|
-
unref(ns).is("on-hover", gutterMarkers.value[c]?.get(row.n)?.visible === "hover"),
|
|
4749
|
-
gutterMarkers.value[c]?.get(row.n)?.class
|
|
4750
|
-
],
|
|
4751
|
-
style: { width: `${column.width}px` },
|
|
4752
|
-
title: gutterMarkers.value[c]?.get(row.n)?.title,
|
|
4753
|
-
"data-gutter-cell": column.onPress && (column.pressOn !== "markers" || gutterMarkers.value[c]?.has(row.n)) ? c : void 0,
|
|
4754
|
-
"data-line": row.n
|
|
4755
|
-
}, { ref_for: true }, column.onPress && gutterMarkers.value[c]?.get(row.n) && !__props.disabled ? {
|
|
4756
|
-
role: "button",
|
|
4757
|
-
tabindex: row.n === activeLineNumber.value ? 0 : -1,
|
|
4758
|
-
"aria-label": gutterMarkers.value[c].get(row.n).title
|
|
4759
|
-
} : { "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);
|
|
4760
|
-
}), 128))], 2)) : createCommentVNode("", true),
|
|
4761
|
-
__props.lineNumbers ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(row.n), 1)) : createCommentVNode("", true),
|
|
4762
|
-
__props.foldable && (row.folded || foldableLines.value.has(row.n)) ? (openBlock(), createElementBlock("span", {
|
|
4763
|
-
key: 2,
|
|
4764
|
-
class: normalizeClass([unref(ns).e("fold-toggle"), unref(ns).is("folded", row.folded)]),
|
|
4765
|
-
"data-fold": row.n,
|
|
4766
|
-
"aria-hidden": "true"
|
|
4767
|
-
}, [row.folded ? (openBlock(), createBlock(unref(ChevronRightIcon), { key: 0 })) : (openBlock(), createBlock(unref(ChevronDownIcon), { key: 1 }))], 10, _hoisted_3)) : createCommentVNode("", true)
|
|
4768
|
-
], 6);
|
|
4769
|
-
}), 128))], 6)], 34)) : createCommentVNode("", true), createElementVNode("div", {
|
|
4770
|
-
ref_key: "content",
|
|
4771
|
-
ref: content,
|
|
4772
|
-
class: normalizeClass(unref(ns).e("content")),
|
|
4773
|
-
onPointerdown: _cache[21] || (_cache[21] = ($event) => onPointerDown($event, "text")),
|
|
4774
|
-
onPointermove: _cache[22] || (_cache[22] = ($event) => (onPointerMove($event), onContentHover($event))),
|
|
4775
|
-
onPointerup: _cache[23] || (_cache[23] = ($event) => onPointerUp($event, "text")),
|
|
4776
|
-
onPointercancel: onPointerCancel,
|
|
4777
|
-
onPointerleave: onContentLeave,
|
|
4778
|
-
onMousedown: _cache[24] || (_cache[24] = withModifiers(() => {}, ["prevent"]))
|
|
4779
4865
|
}, [
|
|
4780
|
-
|
|
4781
|
-
ref_key: "probe",
|
|
4782
|
-
ref: probe,
|
|
4783
|
-
class: normalizeClass(unref(ns).e("probe")),
|
|
4784
|
-
"aria-hidden": "true"
|
|
4785
|
-
}, null, 2),
|
|
4786
|
-
__props.activeLine && activeLineTop.value !== null && !__props.disabled ? (openBlock(), createElementBlock("div", {
|
|
4866
|
+
__props.gutter && (__props.lineNumbers || __props.foldable || gutterColumns.value.length) ? (openBlock(), createElementBlock("div", {
|
|
4787
4867
|
key: 0,
|
|
4788
|
-
class: normalizeClass(unref(ns).e("
|
|
4789
|
-
|
|
4790
|
-
|
|
4791
|
-
|
|
4792
|
-
|
|
4793
|
-
|
|
4794
|
-
|
|
4795
|
-
|
|
4796
|
-
|
|
4797
|
-
|
|
4798
|
-
|
|
4799
|
-
|
|
4800
|
-
class: normalizeClass([unref(ns).e("match"), unref(ns).is("current", box.current)]),
|
|
4801
|
-
style: normalizeStyle({
|
|
4802
|
-
transform: `translate(${box.left}px, ${box.top}px)`,
|
|
4803
|
-
width: `${box.width}px`
|
|
4804
|
-
})
|
|
4805
|
-
}, null, 6);
|
|
4806
|
-
}), 128))], 2),
|
|
4807
|
-
createElementVNode("div", {
|
|
4808
|
-
class: normalizeClass(unref(ns).e("brackets")),
|
|
4809
|
-
"aria-hidden": "true"
|
|
4810
|
-
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(bracketBoxes.value, (box) => {
|
|
4868
|
+
class: normalizeClass(unref(ns).e("gutter")),
|
|
4869
|
+
onPointerdown: _cache[5] || (_cache[5] = ($event) => onPointerDown($event, "gutter")),
|
|
4870
|
+
onPointermove: onPointerMove,
|
|
4871
|
+
onPointerup: _cache[6] || (_cache[6] = ($event) => onPointerUp($event, "gutter")),
|
|
4872
|
+
onPointercancel: onPointerCancel,
|
|
4873
|
+
onPointerenter: _cache[7] || (_cache[7] = ($event) => gutterHover.value = true),
|
|
4874
|
+
onPointerleave: _cache[8] || (_cache[8] = ($event) => gutterHover.value = false),
|
|
4875
|
+
onMousedown: _cache[9] || (_cache[9] = withModifiers(() => {}, ["prevent"]))
|
|
4876
|
+
}, [createElementVNode("div", {
|
|
4877
|
+
class: normalizeClass(unref(ns).e("numbers")),
|
|
4878
|
+
style: normalizeStyle({ transform: `translateY(${yOf(visibleFrom.value)}px)` })
|
|
4879
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(rows.value, (row) => {
|
|
4811
4880
|
return openBlock(), createElementBlock("div", {
|
|
4812
|
-
key:
|
|
4813
|
-
class: normalizeClass([
|
|
4881
|
+
key: row.n,
|
|
4882
|
+
class: normalizeClass([
|
|
4883
|
+
unref(ns).e("number"),
|
|
4884
|
+
unref(ns).is("active", row.n === activeLineNumber.value),
|
|
4885
|
+
unref(ns).is("hovered", row.n === hoveredLine.value)
|
|
4886
|
+
]),
|
|
4814
4887
|
style: normalizeStyle({
|
|
4815
|
-
|
|
4816
|
-
|
|
4888
|
+
height: row.wrapped.breaks.length ? `${(row.wrapped.breaks.length + 1) * lineHeight.value}px` : void 0,
|
|
4889
|
+
marginTop: gapBefore(row.n) ? `${gapBefore(row.n)}px` : void 0
|
|
4817
4890
|
})
|
|
4818
|
-
},
|
|
4819
|
-
|
|
4891
|
+
}, [
|
|
4892
|
+
flowGutterColumns.value.length ? (openBlock(), createElementBlock("span", {
|
|
4893
|
+
key: 0,
|
|
4894
|
+
class: normalizeClass(unref(ns).e("cells"))
|
|
4895
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(flowGutterColumns.value, (item) => {
|
|
4896
|
+
return openBlock(), createElementBlock("span", mergeProps({
|
|
4897
|
+
key: item.column.name,
|
|
4898
|
+
class: [
|
|
4899
|
+
unref(ns).e("cell"),
|
|
4900
|
+
unref(ns).is("on-hover", gutterMarkers.value[item.index]?.get(row.n)?.visible === "hover"),
|
|
4901
|
+
gutterMarkers.value[item.index]?.get(row.n)?.class
|
|
4902
|
+
],
|
|
4903
|
+
style: { width: `${item.column.width}px` },
|
|
4904
|
+
title: gutterMarkers.value[item.index]?.get(row.n)?.title,
|
|
4905
|
+
"data-gutter-cell": item.column.onPress && (item.column.pressOn !== "markers" || gutterMarkers.value[item.index]?.has(row.n)) ? item.index : void 0,
|
|
4906
|
+
"data-line": row.n
|
|
4907
|
+
}, { ref_for: true }, item.column.onPress && gutterMarkers.value[item.index]?.get(row.n) && !__props.disabled ? {
|
|
4908
|
+
role: "button",
|
|
4909
|
+
tabindex: row.n === activeLineNumber.value ? 0 : -1,
|
|
4910
|
+
"aria-label": gutterMarkers.value[item.index].get(row.n).title
|
|
4911
|
+
} : { "aria-hidden": "true" }, { onKeydown: ($event) => onCellKeydown($event, item.index, row.n) }), [gutterMarkers.value[item.index]?.get(row.n) ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [gutterMarkers.value[item.index].get(row.n).icon ? (openBlock(), createBlock(resolveDynamicComponent(gutterMarkers.value[item.index].get(row.n).icon), { key: 0 })) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(gutterMarkers.value[item.index].get(row.n).text), 1)], 64))], 64)) : createCommentVNode("", true)], 16, _hoisted_1);
|
|
4912
|
+
}), 128))], 2)) : createCommentVNode("", true),
|
|
4913
|
+
__props.lineNumbers ? (openBlock(), createElementBlock("span", _hoisted_2, toDisplayString(row.n), 1)) : createCommentVNode("", true),
|
|
4914
|
+
__props.foldable && (row.folded || foldableLines.value.has(row.n)) ? (openBlock(), createElementBlock("span", {
|
|
4915
|
+
key: 2,
|
|
4916
|
+
class: normalizeClass([unref(ns).e("fold-toggle"), unref(ns).is("folded", row.folded)]),
|
|
4917
|
+
"data-fold": row.n,
|
|
4918
|
+
"aria-hidden": "true"
|
|
4919
|
+
}, [row.folded ? (openBlock(), createBlock(unref(ChevronRightIcon), { key: 0 })) : (openBlock(), createBlock(unref(ChevronDownIcon), { key: 1 }))], 10, _hoisted_3)) : createCommentVNode("", true),
|
|
4920
|
+
overlayGutterColumns.value.length ? (openBlock(), createElementBlock("span", {
|
|
4921
|
+
key: 3,
|
|
4922
|
+
class: normalizeClass(unref(ns).e("overlays"))
|
|
4923
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(overlayGutterColumns.value, (item) => {
|
|
4924
|
+
return openBlock(), createElementBlock(Fragment, { key: item.column.name }, [gutterMarkers.value[item.index]?.get(row.n) ? (openBlock(), createElementBlock("span", mergeProps({
|
|
4925
|
+
key: 0,
|
|
4926
|
+
class: [
|
|
4927
|
+
unref(ns).e("cell"),
|
|
4928
|
+
unref(ns).is("overlay", true),
|
|
4929
|
+
unref(ns).is("on-hover", gutterMarkers.value[item.index].get(row.n).visible === "hover"),
|
|
4930
|
+
gutterMarkers.value[item.index].get(row.n).class
|
|
4931
|
+
],
|
|
4932
|
+
style: { width: `${item.column.width}px` },
|
|
4933
|
+
title: gutterMarkers.value[item.index].get(row.n).title,
|
|
4934
|
+
"data-gutter-cell": item.column.onPress ? item.index : void 0,
|
|
4935
|
+
"data-line": row.n
|
|
4936
|
+
}, { ref_for: true }, item.column.onPress && !__props.disabled ? {
|
|
4937
|
+
role: "button",
|
|
4938
|
+
tabindex: row.n === activeLineNumber.value ? 0 : -1,
|
|
4939
|
+
"aria-label": gutterMarkers.value[item.index].get(row.n).title
|
|
4940
|
+
} : { "aria-hidden": "true" }, { onKeydown: ($event) => onCellKeydown($event, item.index, row.n) }), [gutterMarkers.value[item.index].get(row.n).icon ? (openBlock(), createBlock(resolveDynamicComponent(gutterMarkers.value[item.index].get(row.n).icon), { key: 0 })) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(gutterMarkers.value[item.index].get(row.n).text), 1)], 64))], 16, _hoisted_4)) : createCommentVNode("", true)], 64);
|
|
4941
|
+
}), 128))], 2)) : createCommentVNode("", true)
|
|
4942
|
+
], 6);
|
|
4943
|
+
}), 128))], 6)], 34)) : createCommentVNode("", true),
|
|
4820
4944
|
createElementVNode("div", {
|
|
4821
|
-
|
|
4822
|
-
|
|
4823
|
-
|
|
4824
|
-
|
|
4825
|
-
|
|
4826
|
-
|
|
4945
|
+
ref_key: "content",
|
|
4946
|
+
ref: content,
|
|
4947
|
+
class: normalizeClass(unref(ns).e("content")),
|
|
4948
|
+
onPointerdown: _cache[18] || (_cache[18] = ($event) => onPointerDown($event, "text")),
|
|
4949
|
+
onPointermove: _cache[19] || (_cache[19] = ($event) => (onPointerMove($event), onContentHover($event))),
|
|
4950
|
+
onPointerup: _cache[20] || (_cache[20] = ($event) => onPointerUp($event, "text")),
|
|
4951
|
+
onPointercancel: onPointerCancel,
|
|
4952
|
+
onPointerleave: onContentLeave,
|
|
4953
|
+
onMousedown: _cache[21] || (_cache[21] = withModifiers(() => {}, ["prevent"]))
|
|
4954
|
+
}, [
|
|
4955
|
+
createElementVNode("div", {
|
|
4956
|
+
ref_key: "probe",
|
|
4957
|
+
ref: probe,
|
|
4958
|
+
class: normalizeClass(unref(ns).e("probe")),
|
|
4959
|
+
"aria-hidden": "true"
|
|
4960
|
+
}, null, 2),
|
|
4961
|
+
__props.activeLine && activeLineTop.value !== null && !__props.disabled ? (openBlock(), createElementBlock("div", {
|
|
4962
|
+
key: 0,
|
|
4963
|
+
class: normalizeClass(unref(ns).e("active-line")),
|
|
4827
4964
|
style: normalizeStyle({
|
|
4828
|
-
transform: `
|
|
4829
|
-
|
|
4965
|
+
transform: `translateY(${activeLineTop.value}px)`,
|
|
4966
|
+
height: activeLineRows.value > 1 ? `${activeLineRows.value * lineHeight.value}px` : void 0
|
|
4830
4967
|
})
|
|
4831
|
-
}, null, 6)
|
|
4832
|
-
|
|
4833
|
-
|
|
4834
|
-
|
|
4835
|
-
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
|
|
4839
|
-
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
|
|
4844
|
-
|
|
4845
|
-
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
|
|
4849
|
-
|
|
4850
|
-
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
|
|
4856
|
-
|
|
4857
|
-
|
|
4858
|
-
|
|
4859
|
-
|
|
4860
|
-
|
|
4861
|
-
|
|
4862
|
-
], 64)) : row.wrapped.breaks.length ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(row.wrapped.breaks.length + 1, (_, sub) => {
|
|
4968
|
+
}, null, 6)) : createCommentVNode("", true),
|
|
4969
|
+
createElementVNode("div", {
|
|
4970
|
+
class: normalizeClass(unref(ns).e("matches")),
|
|
4971
|
+
"aria-hidden": "true"
|
|
4972
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(matchBoxes.value, (box) => {
|
|
4973
|
+
return openBlock(), createElementBlock("div", {
|
|
4974
|
+
key: box.key,
|
|
4975
|
+
class: normalizeClass([unref(ns).e("match"), unref(ns).is("current", box.current)]),
|
|
4976
|
+
style: normalizeStyle({
|
|
4977
|
+
transform: `translate(${box.left}px, ${box.top}px)`,
|
|
4978
|
+
width: `${box.width}px`
|
|
4979
|
+
})
|
|
4980
|
+
}, null, 6);
|
|
4981
|
+
}), 128))], 2),
|
|
4982
|
+
createElementVNode("div", {
|
|
4983
|
+
class: normalizeClass(unref(ns).e("brackets")),
|
|
4984
|
+
"aria-hidden": "true"
|
|
4985
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(bracketBoxes.value, (box) => {
|
|
4986
|
+
return openBlock(), createElementBlock("div", {
|
|
4987
|
+
key: box.key,
|
|
4988
|
+
class: normalizeClass([unref(ns).e("bracket"), unref(ns).is("unmatched", !box.matched)]),
|
|
4989
|
+
style: normalizeStyle({
|
|
4990
|
+
transform: `translate(${box.left}px, ${box.top}px)`,
|
|
4991
|
+
width: `${box.width}px`
|
|
4992
|
+
})
|
|
4993
|
+
}, null, 6);
|
|
4994
|
+
}), 128))], 2),
|
|
4995
|
+
createElementVNode("div", {
|
|
4996
|
+
class: normalizeClass(unref(ns).e("selections")),
|
|
4997
|
+
"aria-hidden": "true"
|
|
4998
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(selectionBoxes.value, (box) => {
|
|
4863
4999
|
return openBlock(), createElementBlock("div", {
|
|
4864
|
-
key:
|
|
4865
|
-
class: normalizeClass(unref(ns).e("
|
|
4866
|
-
style: normalizeStyle(
|
|
4867
|
-
|
|
5000
|
+
key: box.key,
|
|
5001
|
+
class: normalizeClass(unref(ns).e("selection")),
|
|
5002
|
+
style: normalizeStyle({
|
|
5003
|
+
transform: `translate(${box.left}px, ${box.top}px)`,
|
|
5004
|
+
width: `${box.width}px`
|
|
5005
|
+
})
|
|
5006
|
+
}, null, 6);
|
|
5007
|
+
}), 128))], 2),
|
|
5008
|
+
createElementVNode("div", {
|
|
5009
|
+
class: normalizeClass(unref(ns).e("lines")),
|
|
5010
|
+
"aria-hidden": "true",
|
|
5011
|
+
style: normalizeStyle({ transform: `translateY(${yOf(visibleFrom.value)}px)` })
|
|
5012
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(rows.value, (row, __, ___, _cached) => {
|
|
5013
|
+
const _memo = [
|
|
5014
|
+
row.text,
|
|
5015
|
+
row.tokens,
|
|
5016
|
+
row.compose?.join("\0"),
|
|
5017
|
+
row.wrapped,
|
|
5018
|
+
row.folded,
|
|
5019
|
+
row.marksKey,
|
|
5020
|
+
row.inlinesKey,
|
|
5021
|
+
row.lineClass,
|
|
5022
|
+
gapBefore(row.n)
|
|
5023
|
+
];
|
|
5024
|
+
if (_cached && _cached.el && _cached.key === row.n && isMemoSame(_cached, _memo)) return _cached;
|
|
5025
|
+
const _item = (openBlock(), createElementBlock("div", {
|
|
5026
|
+
key: row.n,
|
|
5027
|
+
class: normalizeClass([
|
|
5028
|
+
unref(ns).e("line"),
|
|
5029
|
+
unref(ns).is("wrapped", !!row.wrapped.breaks.length),
|
|
5030
|
+
row.lineClass
|
|
5031
|
+
]),
|
|
5032
|
+
style: normalizeStyle(gapBefore(row.n) ? { marginTop: `${gapBefore(row.n)}px` } : void 0)
|
|
5033
|
+
}, [row.compose ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
5034
|
+
createTextVNode(toDisplayString(row.compose[0]), 1),
|
|
5035
|
+
createElementVNode("span", { class: normalizeClass(unref(ns).e("compose")) }, toDisplayString(row.compose[1]), 3),
|
|
5036
|
+
createTextVNode(toDisplayString(row.compose[2]), 1)
|
|
5037
|
+
], 64)) : row.wrapped.breaks.length ? (openBlock(true), createElementBlock(Fragment, { key: 1 }, renderList(row.wrapped.breaks.length + 1, (_, sub) => {
|
|
5038
|
+
return openBlock(), createElementBlock("div", {
|
|
5039
|
+
key: sub,
|
|
5040
|
+
class: normalizeClass(unref(ns).e("row")),
|
|
5041
|
+
style: normalizeStyle(sub ? { paddingLeft: `${row.wrapped.indent}px` } : void 0)
|
|
5042
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(rowParts(row, sub), (part, i) => {
|
|
5043
|
+
return openBlock(), createElementBlock(Fragment, { key: i }, [part[3] !== void 0 ? (openBlock(), createElementBlock("span", {
|
|
5044
|
+
key: 0,
|
|
5045
|
+
ref_for: true,
|
|
5046
|
+
ref: (el) => observeInline(el, row.inlines[part[3]].key, row.inlines[part[3]].width),
|
|
5047
|
+
class: normalizeClass(unref(ns).e("inline")),
|
|
5048
|
+
style: normalizeStyle(row.inlines[part[3]].width !== void 0 ? { width: `${row.inlines[part[3]].width}px` } : void 0)
|
|
5049
|
+
}, [createVNode(unref(render_part_default), { render: row.inlines[part[3]].render }, null, 8, ["render"])], 6)) : part[1] ? (openBlock(), createElementBlock("span", {
|
|
5050
|
+
key: 1,
|
|
5051
|
+
class: normalizeClass(part[1]),
|
|
5052
|
+
title: part[2],
|
|
5053
|
+
style: normalizeStyle(part[4])
|
|
5054
|
+
}, toDisplayString(part[0]), 15, _hoisted_5)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [createTextVNode(toDisplayString(part[0]), 1)], 64))], 64);
|
|
5055
|
+
}), 128)), row.folded && sub === row.wrapped.breaks.length ? (openBlock(), createElementBlock("span", {
|
|
5056
|
+
key: 0,
|
|
5057
|
+
class: normalizeClass(unref(ns).e("fold-marker")),
|
|
5058
|
+
"data-unfold": row.n,
|
|
5059
|
+
title: unref(messages).unfold
|
|
5060
|
+
}, "⋯", 10, _hoisted_6)) : createCommentVNode("", true)], 6);
|
|
5061
|
+
}), 128)) : row.tokens || row.marks || row.inlines ? (openBlock(true), createElementBlock(Fragment, { key: 2 }, renderList(partsOf(row), (part, i) => {
|
|
4868
5062
|
return openBlock(), createElementBlock(Fragment, { key: i }, [part[3] !== void 0 ? (openBlock(), createElementBlock("span", {
|
|
4869
5063
|
key: 0,
|
|
4870
5064
|
ref_for: true,
|
|
@@ -4876,285 +5070,266 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
4876
5070
|
class: normalizeClass(part[1]),
|
|
4877
5071
|
title: part[2],
|
|
4878
5072
|
style: normalizeStyle(part[4])
|
|
4879
|
-
}, toDisplayString(part[0]), 15,
|
|
4880
|
-
}), 128)), row.folded &&
|
|
4881
|
-
key:
|
|
5073
|
+
}, toDisplayString(part[0]), 15, _hoisted_7)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [createTextVNode(toDisplayString(part[0]), 1)], 64))], 64);
|
|
5074
|
+
}), 128)) : (openBlock(), createElementBlock(Fragment, { key: 3 }, [createTextVNode(toDisplayString(row.text), 1)], 64)), row.folded && !row.wrapped.breaks.length ? (openBlock(), createElementBlock("span", {
|
|
5075
|
+
key: 4,
|
|
4882
5076
|
class: normalizeClass(unref(ns).e("fold-marker")),
|
|
4883
5077
|
"data-unfold": row.n,
|
|
4884
5078
|
title: unref(messages).unfold
|
|
4885
|
-
}, "⋯", 10,
|
|
4886
|
-
|
|
4887
|
-
return
|
|
5079
|
+
}, "⋯", 10, _hoisted_8)) : createCommentVNode("", true)], 6));
|
|
5080
|
+
_item.memo = _memo;
|
|
5081
|
+
return _item;
|
|
5082
|
+
}, _cache, 10), 128))], 6),
|
|
5083
|
+
__props.placeholder && !doc.value.length && !composing.value ? (openBlock(), createElementBlock("div", {
|
|
5084
|
+
key: 1,
|
|
5085
|
+
class: normalizeClass(unref(ns).e("placeholder")),
|
|
5086
|
+
"aria-hidden": "true"
|
|
5087
|
+
}, toDisplayString(__props.placeholder), 3)) : createCommentVNode("", true),
|
|
5088
|
+
focused.value ? (openBlock(), createElementBlock("div", {
|
|
5089
|
+
key: blink.value,
|
|
5090
|
+
class: normalizeClass(unref(ns).e("cursors")),
|
|
5091
|
+
"aria-hidden": "true"
|
|
5092
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(cursors.value, (cursor) => {
|
|
5093
|
+
return openBlock(), createElementBlock("div", {
|
|
5094
|
+
key: cursor.key,
|
|
5095
|
+
class: normalizeClass(unref(ns).e("cursor")),
|
|
5096
|
+
style: normalizeStyle({ transform: `translate(${cursor.left - 1}px, ${cursor.top}px)` })
|
|
5097
|
+
}, null, 6);
|
|
5098
|
+
}), 128))], 2)) : createCommentVNode("", true),
|
|
5099
|
+
(openBlock(), createBlock(Teleport, {
|
|
5100
|
+
to: floatingTarget.value || "body",
|
|
5101
|
+
disabled: !floatingTarget.value
|
|
5102
|
+
}, [createElementVNode("div", {
|
|
5103
|
+
ref_key: "floatingEl",
|
|
5104
|
+
ref: floatingEl,
|
|
5105
|
+
class: normalizeClass([
|
|
5106
|
+
unref(ns).e("floating"),
|
|
5107
|
+
unref(ns).is("outside", !!floatingTarget.value),
|
|
5108
|
+
unref(ns).is("fixed", !!floatingTarget.value && anchorMode.value === "fixed"),
|
|
5109
|
+
unref(ns).is("scrolling", !!floatingTarget.value && boxScrolling.value)
|
|
5110
|
+
]),
|
|
5111
|
+
style: normalizeStyle(floatingTarget.value ? {
|
|
5112
|
+
...frameVars.value,
|
|
5113
|
+
zIndex: floatingZ.value,
|
|
5114
|
+
transform: `translate(${layerShift.value.x}px, ${layerShift.value.y}px)`
|
|
5115
|
+
} : void 0)
|
|
5116
|
+
}, [
|
|
5117
|
+
problemStyle.value ? (openBlock(), createElementBlock("div", {
|
|
4888
5118
|
key: 0,
|
|
4889
|
-
|
|
4890
|
-
ref:
|
|
4891
|
-
class: normalizeClass(unref(ns).e("
|
|
4892
|
-
|
|
4893
|
-
|
|
5119
|
+
ref_key: "problemEl",
|
|
5120
|
+
ref: problemEl,
|
|
5121
|
+
class: normalizeClass(unref(ns).e("problems")),
|
|
5122
|
+
role: "group",
|
|
5123
|
+
"aria-label": problemBox.value.problems.length ? unref(messages).problems : unref(messages).details,
|
|
5124
|
+
style: normalizeStyle(problemStyle.value),
|
|
5125
|
+
onPointerdown: _cache[12] || (_cache[12] = withModifiers(() => {}, ["stop", "prevent"])),
|
|
5126
|
+
onPointermove: _cache[13] || (_cache[13] = withModifiers(() => {}, ["stop"])),
|
|
5127
|
+
onPointerenter: keepProblems,
|
|
5128
|
+
onPointerleave: onContentLeave
|
|
5129
|
+
}, [
|
|
5130
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(problemBox.value.info, (item, i) => {
|
|
5131
|
+
return openBlock(), createElementBlock("div", {
|
|
5132
|
+
key: `info-${i}`,
|
|
5133
|
+
class: normalizeClass(unref(ns).e("hover"))
|
|
5134
|
+
}, [typeof item === "string" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(toDisplayString(item), 1)], 64)) : (openBlock(), createBlock(unref(render_part_default), {
|
|
5135
|
+
key: 1,
|
|
5136
|
+
render: item
|
|
5137
|
+
}, null, 8, ["render"]))], 2);
|
|
5138
|
+
}), 128)),
|
|
5139
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(problemBox.value.problems, (problem, i) => {
|
|
5140
|
+
return openBlock(), createElementBlock("div", {
|
|
5141
|
+
key: i,
|
|
5142
|
+
class: normalizeClass([unref(ns).e("problem-item"), unref(ns).is(problem.severity, true)])
|
|
5143
|
+
}, [(openBlock(), createBlock(resolveDynamicComponent(SEVERITY_ICON[problem.severity]), { class: normalizeClass(unref(ns).e("problem-severity")) }, null, 8, ["class"])), createElementVNode("span", { class: normalizeClass(unref(ns).e("problem-message")) }, [createTextVNode(toDisplayString(problem.message), 1), problem.source ? (openBlock(), createElementBlock("span", {
|
|
5144
|
+
key: 0,
|
|
5145
|
+
class: normalizeClass(unref(ns).e("problem-source"))
|
|
5146
|
+
}, toDisplayString(problem.source), 3)) : createCommentVNode("", true)], 2)], 2);
|
|
5147
|
+
}), 128)),
|
|
5148
|
+
fixes.value.length ? (openBlock(), createElementBlock("div", {
|
|
5149
|
+
key: 0,
|
|
5150
|
+
class: normalizeClass(unref(ns).e("fixes"))
|
|
5151
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(fixes.value, (fix, i) => {
|
|
5152
|
+
return openBlock(), createElementBlock("button", {
|
|
5153
|
+
key: i,
|
|
5154
|
+
type: "button",
|
|
5155
|
+
tabindex: "-1",
|
|
5156
|
+
class: normalizeClass([unref(ns).e("fix"), unref(ns).is("active", i === problemBox.value.index)]),
|
|
5157
|
+
"aria-current": i === problemBox.value.index || void 0,
|
|
5158
|
+
onClick: ($event) => runFix(i)
|
|
5159
|
+
}, toDisplayString(fix.action.label), 11, _hoisted_10);
|
|
5160
|
+
}), 128))], 2)) : createCommentVNode("", true)
|
|
5161
|
+
], 46, _hoisted_9)) : createCommentVNode("", true),
|
|
5162
|
+
completionStyle.value ? (openBlock(), createElementBlock("div", {
|
|
4894
5163
|
key: 1,
|
|
4895
|
-
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
|
|
4899
|
-
|
|
4900
|
-
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
4908
|
-
|
|
4909
|
-
key: 1,
|
|
4910
|
-
class: normalizeClass(unref(ns).e("placeholder")),
|
|
4911
|
-
"aria-hidden": "true"
|
|
4912
|
-
}, toDisplayString(__props.placeholder), 3)) : createCommentVNode("", true),
|
|
4913
|
-
focused.value ? (openBlock(), createElementBlock("div", {
|
|
4914
|
-
key: blink.value,
|
|
4915
|
-
class: normalizeClass(unref(ns).e("cursors")),
|
|
4916
|
-
"aria-hidden": "true"
|
|
4917
|
-
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(cursors.value, (cursor) => {
|
|
4918
|
-
return openBlock(), createElementBlock("div", {
|
|
4919
|
-
key: cursor.key,
|
|
4920
|
-
class: normalizeClass(unref(ns).e("cursor")),
|
|
4921
|
-
style: normalizeStyle({ transform: `translate(${cursor.left - 1}px, ${cursor.top}px)` })
|
|
4922
|
-
}, null, 6);
|
|
4923
|
-
}), 128))], 2)) : createCommentVNode("", true),
|
|
4924
|
-
(openBlock(), createBlock(Teleport, {
|
|
4925
|
-
to: floatingTarget.value || "body",
|
|
4926
|
-
disabled: !floatingTarget.value
|
|
4927
|
-
}, [createElementVNode("div", {
|
|
4928
|
-
ref_key: "floatingEl",
|
|
4929
|
-
ref: floatingEl,
|
|
4930
|
-
class: normalizeClass([
|
|
4931
|
-
unref(ns).e("floating"),
|
|
4932
|
-
unref(ns).is("outside", !!floatingTarget.value),
|
|
4933
|
-
unref(ns).is("fixed", !!floatingTarget.value && anchorMode.value === "fixed"),
|
|
4934
|
-
unref(ns).is("scrolling", !!floatingTarget.value && boxScrolling.value)
|
|
4935
|
-
]),
|
|
4936
|
-
style: normalizeStyle(floatingTarget.value ? {
|
|
4937
|
-
...frameVars.value,
|
|
4938
|
-
zIndex: floatingZ.value,
|
|
4939
|
-
transform: `translate(${layerShift.value.x}px, ${layerShift.value.y}px)`
|
|
4940
|
-
} : void 0)
|
|
4941
|
-
}, [
|
|
4942
|
-
problemStyle.value ? (openBlock(), createElementBlock("div", {
|
|
4943
|
-
key: 0,
|
|
4944
|
-
ref_key: "problemEl",
|
|
4945
|
-
ref: problemEl,
|
|
4946
|
-
class: normalizeClass(unref(ns).e("problems")),
|
|
4947
|
-
role: "group",
|
|
4948
|
-
"aria-label": problemBox.value.problems.length ? unref(messages).problems : unref(messages).details,
|
|
4949
|
-
style: normalizeStyle(problemStyle.value),
|
|
4950
|
-
onPointerdown: _cache[12] || (_cache[12] = withModifiers(() => {}, ["stop", "prevent"])),
|
|
4951
|
-
onPointermove: _cache[13] || (_cache[13] = withModifiers(() => {}, ["stop"])),
|
|
4952
|
-
onPointerenter: keepProblems,
|
|
4953
|
-
onPointerleave: onContentLeave
|
|
4954
|
-
}, [
|
|
4955
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(problemBox.value.info, (item, i) => {
|
|
4956
|
-
return openBlock(), createElementBlock("div", {
|
|
4957
|
-
key: `info-${i}`,
|
|
4958
|
-
class: normalizeClass(unref(ns).e("hover"))
|
|
4959
|
-
}, [typeof item === "string" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createTextVNode(toDisplayString(item), 1)], 64)) : (openBlock(), createBlock(unref(render_part_default), {
|
|
4960
|
-
key: 1,
|
|
4961
|
-
render: item
|
|
4962
|
-
}, null, 8, ["render"]))], 2);
|
|
4963
|
-
}), 128)),
|
|
4964
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(problemBox.value.problems, (problem, i) => {
|
|
5164
|
+
ref_key: "completionEl",
|
|
5165
|
+
ref: completionEl,
|
|
5166
|
+
class: normalizeClass(unref(ns).e("completions")),
|
|
5167
|
+
style: normalizeStyle(completionStyle.value),
|
|
5168
|
+
onPointerdown: _cache[14] || (_cache[14] = withModifiers(() => {}, ["stop", "prevent"])),
|
|
5169
|
+
onPointermove: _cache[15] || (_cache[15] = withModifiers(() => {}, ["stop"]))
|
|
5170
|
+
}, [createElementVNode("div", {
|
|
5171
|
+
id: completionId,
|
|
5172
|
+
ref_key: "completionList",
|
|
5173
|
+
ref: completionList,
|
|
5174
|
+
class: normalizeClass(unref(ns).e("completion-list")),
|
|
5175
|
+
role: "listbox",
|
|
5176
|
+
"aria-label": unref(messages).completions
|
|
5177
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(completion.value.items, (item, i) => {
|
|
4965
5178
|
return openBlock(), createElementBlock("div", {
|
|
5179
|
+
id: `${completionId}-${i}`,
|
|
4966
5180
|
key: i,
|
|
4967
|
-
|
|
4968
|
-
|
|
5181
|
+
role: "option",
|
|
5182
|
+
"aria-selected": i === completion.value.index,
|
|
5183
|
+
class: normalizeClass([unref(ns).e("completion"), unref(ns).is("active", i === completion.value.index)]),
|
|
5184
|
+
onClick: ($event) => acceptCompletion(i)
|
|
5185
|
+
}, [
|
|
5186
|
+
(openBlock(), createBlock(resolveDynamicComponent(KIND_ICON[item.option.kind ?? "text"]), {
|
|
5187
|
+
class: normalizeClass([unref(ns).e("completion-kind"), unref(ns).is(item.option.kind ?? "text", true)]),
|
|
5188
|
+
"aria-hidden": "true"
|
|
5189
|
+
}, null, 8, ["class"])),
|
|
5190
|
+
createElementVNode("span", { class: normalizeClass(unref(ns).e("completion-label")) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(labelParts(item), (part, j) => {
|
|
5191
|
+
return openBlock(), createElementBlock(Fragment, { key: j }, [part[1] ? (openBlock(), createElementBlock("mark", {
|
|
5192
|
+
key: 0,
|
|
5193
|
+
class: normalizeClass(unref(ns).e("completion-match"))
|
|
5194
|
+
}, toDisplayString(part[0]), 3)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(part[0]), 1)], 64))], 64);
|
|
5195
|
+
}), 128))], 2),
|
|
5196
|
+
item.option.detail ? (openBlock(), createElementBlock("span", {
|
|
5197
|
+
key: 0,
|
|
5198
|
+
class: normalizeClass(unref(ns).e("completion-detail"))
|
|
5199
|
+
}, toDisplayString(item.option.detail), 3)) : createCommentVNode("", true)
|
|
5200
|
+
], 10, _hoisted_12);
|
|
5201
|
+
}), 128))], 10, _hoisted_11), completion.value.items[completion.value.index]?.option.info ? (openBlock(), createElementBlock("div", {
|
|
5202
|
+
key: 0,
|
|
5203
|
+
class: normalizeClass(unref(ns).e("completion-info"))
|
|
5204
|
+
}, [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), {
|
|
5205
|
+
key: 1,
|
|
5206
|
+
render: completion.value.items[completion.value.index].option.info
|
|
5207
|
+
}, null, 8, ["render"]))], 2)) : createCommentVNode("", true)], 38)) : createCommentVNode("", true),
|
|
5208
|
+
signatureStyle.value ? (openBlock(), createElementBlock("div", {
|
|
5209
|
+
key: 2,
|
|
5210
|
+
ref_key: "signatureEl",
|
|
5211
|
+
ref: signatureEl,
|
|
5212
|
+
class: normalizeClass(unref(ns).e("signature")),
|
|
5213
|
+
role: "note",
|
|
5214
|
+
"aria-label": unref(messages).signature,
|
|
5215
|
+
style: normalizeStyle(signatureStyle.value),
|
|
5216
|
+
onPointerdown: _cache[16] || (_cache[16] = withModifiers(() => {}, ["stop", "prevent"]))
|
|
5217
|
+
}, [createElementVNode("div", { class: normalizeClass(unref(ns).e("signature-label")) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(signatureParts.value, (part, i) => {
|
|
5218
|
+
return openBlock(), createElementBlock(Fragment, { key: i }, [part[1] ? (openBlock(), createElementBlock("span", {
|
|
4969
5219
|
key: 0,
|
|
4970
|
-
class: normalizeClass(unref(ns).e("
|
|
4971
|
-
}, toDisplayString(
|
|
4972
|
-
}), 128)),
|
|
4973
|
-
fixes.value.length ? (openBlock(), createElementBlock("div", {
|
|
5220
|
+
class: normalizeClass(unref(ns).e("signature-active"))
|
|
5221
|
+
}, toDisplayString(part[0]), 3)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(part[0]), 1)], 64))], 64);
|
|
5222
|
+
}), 128))], 2), signature.value.result.info ? (openBlock(), createElementBlock("div", {
|
|
4974
5223
|
key: 0,
|
|
4975
|
-
class: normalizeClass(unref(ns).e("
|
|
4976
|
-
}, [(openBlock(
|
|
5224
|
+
class: normalizeClass(unref(ns).e("signature-info"))
|
|
5225
|
+
}, [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), {
|
|
5226
|
+
key: 1,
|
|
5227
|
+
render: signature.value.result.info
|
|
5228
|
+
}, null, 8, ["render"]))], 2)) : createCommentVNode("", true)], 46, _hoisted_13)) : createCommentVNode("", true),
|
|
5229
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(handles.value, (handle) => {
|
|
5230
|
+
return openBlock(), createElementBlock("div", {
|
|
5231
|
+
key: handle.kind,
|
|
5232
|
+
class: normalizeClass([unref(ns).e("handle"), unref(ns).is(handle.kind, true)]),
|
|
5233
|
+
style: normalizeStyle({ transform: `translate(${handle.left}px, ${handle.top}px)` }),
|
|
5234
|
+
"aria-hidden": "true",
|
|
5235
|
+
onPointerdown: ($event) => onHandleDown($event, handle.kind)
|
|
5236
|
+
}, null, 46, _hoisted_14);
|
|
5237
|
+
}), 128)),
|
|
5238
|
+
magnifier.value ? (openBlock(), createElementBlock("div", {
|
|
5239
|
+
key: 3,
|
|
5240
|
+
class: normalizeClass(unref(ns).e("magnifier")),
|
|
5241
|
+
style: normalizeStyle(magnifier.value.style),
|
|
5242
|
+
"aria-hidden": "true"
|
|
5243
|
+
}, [createElementVNode("div", {
|
|
5244
|
+
class: normalizeClass(unref(ns).e("magnifier-text")),
|
|
5245
|
+
style: normalizeStyle([magnifier.value.textStyle, { paddingLeft: `${magnifier.value.indent}px` }])
|
|
5246
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(magnifier.value.parts, (part, i) => {
|
|
5247
|
+
return openBlock(), createElementBlock(Fragment, { key: i }, [part[3] !== void 0 ? (openBlock(), createElementBlock("span", {
|
|
5248
|
+
key: 0,
|
|
5249
|
+
class: normalizeClass(unref(ns).e("inline")),
|
|
5250
|
+
style: normalizeStyle({ width: `${widthOf(magnifier.value.inlines[part[3]])}px` })
|
|
5251
|
+
}, [createVNode(unref(render_part_default), { render: magnifier.value.inlines[part[3]].render }, null, 8, ["render"])], 6)) : part[1] ? (openBlock(), createElementBlock("span", {
|
|
5252
|
+
key: 1,
|
|
5253
|
+
class: normalizeClass(part[1]),
|
|
5254
|
+
title: part[2],
|
|
5255
|
+
style: normalizeStyle(part[4])
|
|
5256
|
+
}, toDisplayString(part[0]), 15, _hoisted_15)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [createTextVNode(toDisplayString(part[0]), 1)], 64))], 64);
|
|
5257
|
+
}), 128))], 6), createElementVNode("div", {
|
|
5258
|
+
class: normalizeClass(unref(ns).e("magnifier-caret")),
|
|
5259
|
+
style: normalizeStyle({ left: `${magnifier.value.caret - 1}px` })
|
|
5260
|
+
}, null, 6)], 6)) : createCommentVNode("", true),
|
|
5261
|
+
menuStyle.value ? (openBlock(), createElementBlock("div", {
|
|
5262
|
+
key: 4,
|
|
5263
|
+
ref_key: "menuEl",
|
|
5264
|
+
ref: menuEl,
|
|
5265
|
+
class: normalizeClass(unref(ns).e("menu")),
|
|
5266
|
+
role: "toolbar",
|
|
5267
|
+
"aria-label": unref(messages).editMenu,
|
|
5268
|
+
style: normalizeStyle(menuStyle.value),
|
|
5269
|
+
onPointerdown: _cache[17] || (_cache[17] = withModifiers(() => {}, ["stop", "prevent"]))
|
|
5270
|
+
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(menuItems.value, (item) => {
|
|
4977
5271
|
return openBlock(), createElementBlock("button", {
|
|
4978
|
-
key:
|
|
5272
|
+
key: item.key,
|
|
4979
5273
|
type: "button",
|
|
4980
5274
|
tabindex: "-1",
|
|
4981
|
-
class: normalizeClass(
|
|
4982
|
-
|
|
4983
|
-
|
|
4984
|
-
|
|
4985
|
-
|
|
4986
|
-
|
|
4987
|
-
|
|
4988
|
-
|
|
4989
|
-
|
|
4990
|
-
|
|
4991
|
-
|
|
4992
|
-
|
|
4993
|
-
|
|
4994
|
-
|
|
4995
|
-
|
|
4996
|
-
|
|
4997
|
-
|
|
4998
|
-
|
|
4999
|
-
|
|
5000
|
-
|
|
5001
|
-
"
|
|
5002
|
-
|
|
5003
|
-
|
|
5004
|
-
|
|
5005
|
-
|
|
5006
|
-
|
|
5007
|
-
|
|
5008
|
-
|
|
5009
|
-
|
|
5010
|
-
|
|
5011
|
-
|
|
5012
|
-
|
|
5013
|
-
|
|
5014
|
-
|
|
5015
|
-
|
|
5016
|
-
|
|
5017
|
-
|
|
5018
|
-
|
|
5019
|
-
}, toDisplayString(part[0]), 3)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(part[0]), 1)], 64))], 64);
|
|
5020
|
-
}), 128))], 2),
|
|
5021
|
-
item.option.detail ? (openBlock(), createElementBlock("span", {
|
|
5022
|
-
key: 0,
|
|
5023
|
-
class: normalizeClass(unref(ns).e("completion-detail"))
|
|
5024
|
-
}, toDisplayString(item.option.detail), 3)) : createCommentVNode("", true)
|
|
5025
|
-
], 10, _hoisted_11);
|
|
5026
|
-
}), 128))], 10, _hoisted_10), completion.value.items[completion.value.index]?.option.info ? (openBlock(), createElementBlock("div", {
|
|
5027
|
-
key: 0,
|
|
5028
|
-
class: normalizeClass(unref(ns).e("completion-info"))
|
|
5029
|
-
}, [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), {
|
|
5030
|
-
key: 1,
|
|
5031
|
-
render: completion.value.items[completion.value.index].option.info
|
|
5032
|
-
}, null, 8, ["render"]))], 2)) : createCommentVNode("", true)], 38)) : createCommentVNode("", true),
|
|
5033
|
-
signatureStyle.value ? (openBlock(), createElementBlock("div", {
|
|
5034
|
-
key: 2,
|
|
5035
|
-
ref_key: "signatureEl",
|
|
5036
|
-
ref: signatureEl,
|
|
5037
|
-
class: normalizeClass(unref(ns).e("signature")),
|
|
5038
|
-
role: "note",
|
|
5039
|
-
"aria-label": unref(messages).signature,
|
|
5040
|
-
style: normalizeStyle(signatureStyle.value),
|
|
5041
|
-
onPointerdown: _cache[16] || (_cache[16] = withModifiers(() => {}, ["stop", "prevent"]))
|
|
5042
|
-
}, [createElementVNode("div", { class: normalizeClass(unref(ns).e("signature-label")) }, [(openBlock(true), createElementBlock(Fragment, null, renderList(signatureParts.value, (part, i) => {
|
|
5043
|
-
return openBlock(), createElementBlock(Fragment, { key: i }, [part[1] ? (openBlock(), createElementBlock("span", {
|
|
5044
|
-
key: 0,
|
|
5045
|
-
class: normalizeClass(unref(ns).e("signature-active"))
|
|
5046
|
-
}, toDisplayString(part[0]), 3)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(part[0]), 1)], 64))], 64);
|
|
5047
|
-
}), 128))], 2), signature.value.result.info ? (openBlock(), createElementBlock("div", {
|
|
5048
|
-
key: 0,
|
|
5049
|
-
class: normalizeClass(unref(ns).e("signature-info"))
|
|
5050
|
-
}, [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), {
|
|
5051
|
-
key: 1,
|
|
5052
|
-
render: signature.value.result.info
|
|
5053
|
-
}, null, 8, ["render"]))], 2)) : createCommentVNode("", true)], 46, _hoisted_12)) : createCommentVNode("", true),
|
|
5054
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(handles.value, (handle) => {
|
|
5055
|
-
return openBlock(), createElementBlock("div", {
|
|
5056
|
-
key: handle.kind,
|
|
5057
|
-
class: normalizeClass([unref(ns).e("handle"), unref(ns).is(handle.kind, true)]),
|
|
5058
|
-
style: normalizeStyle({ transform: `translate(${handle.left}px, ${handle.top}px)` }),
|
|
5059
|
-
"aria-hidden": "true",
|
|
5060
|
-
onPointerdown: ($event) => onHandleDown($event, handle.kind)
|
|
5061
|
-
}, null, 46, _hoisted_13);
|
|
5062
|
-
}), 128)),
|
|
5063
|
-
magnifier.value ? (openBlock(), createElementBlock("div", {
|
|
5064
|
-
key: 3,
|
|
5065
|
-
class: normalizeClass(unref(ns).e("magnifier")),
|
|
5066
|
-
style: normalizeStyle(magnifier.value.style),
|
|
5067
|
-
"aria-hidden": "true"
|
|
5068
|
-
}, [createElementVNode("div", {
|
|
5069
|
-
class: normalizeClass(unref(ns).e("magnifier-text")),
|
|
5070
|
-
style: normalizeStyle([magnifier.value.textStyle, { paddingLeft: `${magnifier.value.indent}px` }])
|
|
5071
|
-
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(magnifier.value.parts, (part, i) => {
|
|
5072
|
-
return openBlock(), createElementBlock(Fragment, { key: i }, [part[3] !== void 0 ? (openBlock(), createElementBlock("span", {
|
|
5073
|
-
key: 0,
|
|
5074
|
-
class: normalizeClass(unref(ns).e("inline")),
|
|
5075
|
-
style: normalizeStyle({ width: `${widthOf(magnifier.value.inlines[part[3]])}px` })
|
|
5076
|
-
}, [createVNode(unref(render_part_default), { render: magnifier.value.inlines[part[3]].render }, null, 8, ["render"])], 6)) : part[1] ? (openBlock(), createElementBlock("span", {
|
|
5077
|
-
key: 1,
|
|
5078
|
-
class: normalizeClass(part[1]),
|
|
5079
|
-
title: part[2],
|
|
5080
|
-
style: normalizeStyle(part[4])
|
|
5081
|
-
}, toDisplayString(part[0]), 15, _hoisted_14)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [createTextVNode(toDisplayString(part[0]), 1)], 64))], 64);
|
|
5082
|
-
}), 128))], 6), createElementVNode("div", {
|
|
5083
|
-
class: normalizeClass(unref(ns).e("magnifier-caret")),
|
|
5084
|
-
style: normalizeStyle({ left: `${magnifier.value.caret - 1}px` })
|
|
5085
|
-
}, null, 6)], 6)) : createCommentVNode("", true),
|
|
5086
|
-
menuStyle.value ? (openBlock(), createElementBlock("div", {
|
|
5087
|
-
key: 4,
|
|
5088
|
-
ref_key: "menuEl",
|
|
5089
|
-
ref: menuEl,
|
|
5090
|
-
class: normalizeClass(unref(ns).e("menu")),
|
|
5091
|
-
role: "toolbar",
|
|
5092
|
-
"aria-label": unref(messages).editMenu,
|
|
5093
|
-
style: normalizeStyle(menuStyle.value),
|
|
5094
|
-
onPointerdown: _cache[17] || (_cache[17] = withModifiers(() => {}, ["stop", "prevent"]))
|
|
5095
|
-
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(menuItems.value, (item) => {
|
|
5096
|
-
return openBlock(), createElementBlock("button", {
|
|
5097
|
-
key: item.key,
|
|
5098
|
-
type: "button",
|
|
5099
|
-
tabindex: "-1",
|
|
5100
|
-
class: normalizeClass(unref(ns).e("menu-button")),
|
|
5101
|
-
onClick: ($event) => item.run()
|
|
5102
|
-
}, toDisplayString(item.label), 11, _hoisted_16);
|
|
5103
|
-
}), 128))], 46, _hoisted_15)) : createCommentVNode("", true)
|
|
5104
|
-
], 6)], 8, ["to", "disabled"])),
|
|
5105
|
-
createElementVNode("textarea", {
|
|
5106
|
-
ref_key: "input",
|
|
5107
|
-
ref: input,
|
|
5108
|
-
class: normalizeClass(unref(ns).e("input")),
|
|
5109
|
-
style: normalizeStyle({
|
|
5110
|
-
top: `${inputBox.value.top}px`,
|
|
5111
|
-
left: `${inputBox.value.left}px`,
|
|
5112
|
-
height: `${inputBox.value.height}px`
|
|
5113
|
-
}),
|
|
5114
|
-
"aria-label": __props.ariaLabel,
|
|
5115
|
-
"aria-placeholder": __props.placeholder || void 0,
|
|
5116
|
-
"aria-autocomplete": hasCompletion.value ? "list" : void 0,
|
|
5117
|
-
"aria-controls": completion.value ? completionId : void 0,
|
|
5118
|
-
readonly: __props.readonly,
|
|
5119
|
-
disabled: __props.disabled,
|
|
5120
|
-
wrap: "off",
|
|
5121
|
-
autocomplete: "off",
|
|
5122
|
-
autocorrect: "off",
|
|
5123
|
-
autocapitalize: "off",
|
|
5124
|
-
spellcheck: "false",
|
|
5125
|
-
enterkeyhint: "enter",
|
|
5126
|
-
onKeydown,
|
|
5127
|
-
onBeforeinput: onBeforeInput,
|
|
5128
|
-
onInput,
|
|
5129
|
-
onCompositionstart: onCompositionStart,
|
|
5130
|
-
onCompositionend: onCompositionEnd,
|
|
5131
|
-
onCopy,
|
|
5132
|
-
onCut,
|
|
5133
|
-
onPaste,
|
|
5134
|
-
onFocus,
|
|
5135
|
-
onBlur
|
|
5136
|
-
}, null, 46, _hoisted_17),
|
|
5275
|
+
class: normalizeClass(unref(ns).e("menu-button")),
|
|
5276
|
+
onClick: ($event) => item.run()
|
|
5277
|
+
}, toDisplayString(item.label), 11, _hoisted_17);
|
|
5278
|
+
}), 128))], 46, _hoisted_16)) : createCommentVNode("", true)
|
|
5279
|
+
], 6)], 8, ["to", "disabled"])),
|
|
5280
|
+
createElementVNode("textarea", {
|
|
5281
|
+
ref_key: "input",
|
|
5282
|
+
ref: input,
|
|
5283
|
+
class: normalizeClass(unref(ns).e("input")),
|
|
5284
|
+
style: normalizeStyle({
|
|
5285
|
+
top: `${inputBox.value.top}px`,
|
|
5286
|
+
left: `${inputBox.value.left}px`,
|
|
5287
|
+
height: `${inputBox.value.height}px`
|
|
5288
|
+
}),
|
|
5289
|
+
"aria-label": __props.ariaLabel,
|
|
5290
|
+
"aria-placeholder": __props.placeholder || void 0,
|
|
5291
|
+
"aria-autocomplete": hasCompletion.value ? "list" : void 0,
|
|
5292
|
+
"aria-controls": completion.value ? completionId : void 0,
|
|
5293
|
+
readonly: __props.readonly,
|
|
5294
|
+
disabled: __props.disabled,
|
|
5295
|
+
wrap: "off",
|
|
5296
|
+
autocomplete: "off",
|
|
5297
|
+
autocorrect: "off",
|
|
5298
|
+
autocapitalize: "off",
|
|
5299
|
+
spellcheck: "false",
|
|
5300
|
+
enterkeyhint: "enter",
|
|
5301
|
+
onKeydown,
|
|
5302
|
+
onBeforeinput: onBeforeInput,
|
|
5303
|
+
onInput,
|
|
5304
|
+
onCompositionstart: onCompositionStart,
|
|
5305
|
+
onCompositionend: onCompositionEnd,
|
|
5306
|
+
onCopy,
|
|
5307
|
+
onCut,
|
|
5308
|
+
onPaste,
|
|
5309
|
+
onFocus,
|
|
5310
|
+
onBlur
|
|
5311
|
+
}, null, 46, _hoisted_18)
|
|
5312
|
+
], 34),
|
|
5137
5313
|
shownWidgets.value.length ? (openBlock(), createElementBlock("div", {
|
|
5138
|
-
key:
|
|
5314
|
+
key: 1,
|
|
5139
5315
|
class: normalizeClass(unref(ns).e("widgets")),
|
|
5140
|
-
onPointerdown: _cache[
|
|
5141
|
-
onPointermove: _cache[
|
|
5142
|
-
onMousedown: _cache[
|
|
5316
|
+
onPointerdown: _cache[22] || (_cache[22] = withModifiers(() => {}, ["stop"])),
|
|
5317
|
+
onPointermove: _cache[23] || (_cache[23] = withModifiers(() => {}, ["stop"])),
|
|
5318
|
+
onMousedown: _cache[24] || (_cache[24] = withModifiers(() => {}, ["stop"]))
|
|
5143
5319
|
}, [(openBlock(true), createElementBlock(Fragment, null, renderList(shownWidgets.value, (widget) => {
|
|
5144
5320
|
return openBlock(), createElementBlock("div", {
|
|
5145
5321
|
key: widget.key,
|
|
5322
|
+
class: normalizeClass([unref(ns).e("widget-slot"), unref(ns).is("full-width", widget.fullWidth)]),
|
|
5323
|
+
style: normalizeStyle({ top: `${widget.top}px` })
|
|
5324
|
+
}, [createElementVNode("div", {
|
|
5146
5325
|
ref_for: true,
|
|
5147
5326
|
ref: (el) => observeWidget(el, widget.key),
|
|
5148
|
-
class: normalizeClass(unref(ns).e("widget")),
|
|
5327
|
+
class: normalizeClass([unref(ns).e("widget"), unref(ns).is("full-width", widget.fullWidth)]),
|
|
5149
5328
|
role: widget.label ? "group" : void 0,
|
|
5150
|
-
"aria-label": widget.label
|
|
5151
|
-
|
|
5152
|
-
transform: `translate(${scrollLeft.value}px, ${widget.top}px)`,
|
|
5153
|
-
width: `${Math.max(0, viewWidth.value - gutterWidth.value)}px`
|
|
5154
|
-
})
|
|
5155
|
-
}, [createVNode(unref(render_part_default), { render: widget.render }, null, 8, ["render"])], 14, _hoisted_18);
|
|
5329
|
+
"aria-label": widget.label
|
|
5330
|
+
}, [createVNode(unref(render_part_default), { render: widget.render }, null, 8, ["render"])], 10, _hoisted_19)], 6);
|
|
5156
5331
|
}), 128))], 34)) : createCommentVNode("", true)
|
|
5157
|
-
],
|
|
5332
|
+
], 6)], 34), minimapOn.value && minimap.value ? (openBlock(), createElementBlock("div", {
|
|
5158
5333
|
key: 0,
|
|
5159
5334
|
class: normalizeClass(unref(ns).e("minimap")),
|
|
5160
5335
|
"aria-hidden": "true",
|
|
@@ -5204,7 +5379,7 @@ var code_editor_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defi
|
|
|
5204
5379
|
onPointerdown: onKeysGripDown,
|
|
5205
5380
|
onKeydown: onKeysGripKey,
|
|
5206
5381
|
onMousedown: _cache[25] || (_cache[25] = withModifiers(() => {}, ["prevent"]))
|
|
5207
|
-
}, [createVNode(unref(GripVerticalIcon))], 42,
|
|
5382
|
+
}, [createVNode(unref(GripVerticalIcon))], 42, _hoisted_20), createVNode(code_keys_default, {
|
|
5208
5383
|
editor: keysEditor,
|
|
5209
5384
|
keys: keysList.value,
|
|
5210
5385
|
messages: unref(messages)
|