@onerjs/code-input 0.1.6 → 0.1.7
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-input.cjs +18 -18
- package/dist/code-input.es.js +395 -391
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/code-input.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
const
|
|
1
|
+
import { defineComponent as Dt, ref as E, computed as q, watch as Ze, nextTick as V, onMounted as jt, onBeforeUnmount as Ft, openBlock as H, createElementBlock as L, normalizeStyle as he, normalizeClass as ie, createElementVNode as B, withModifiers as Ue, Fragment as Ye, renderList as Xe, toDisplayString as Y, createCommentVNode as K, createTextVNode as Pt } from "vue";
|
|
2
|
+
const Vt = [
|
|
3
3
|
{
|
|
4
4
|
label: "Math",
|
|
5
5
|
kind: "class",
|
|
@@ -134,8 +134,8 @@ const zt = [
|
|
|
134
134
|
kind: "function",
|
|
135
135
|
detail: "(id: number) => void"
|
|
136
136
|
}
|
|
137
|
-
],
|
|
138
|
-
function
|
|
137
|
+
], qt = /[\w$]/;
|
|
138
|
+
function Kt(n, s) {
|
|
139
139
|
const o = [];
|
|
140
140
|
let e = null;
|
|
141
141
|
for (let S = 0; S < s; S++) {
|
|
@@ -163,22 +163,22 @@ function jt(n, s) {
|
|
|
163
163
|
let r = i.index - 1;
|
|
164
164
|
for (; r >= 0 && /\s/.test(n[r]); ) r--;
|
|
165
165
|
const f = r;
|
|
166
|
-
for (; r >= 0 &&
|
|
166
|
+
for (; r >= 0 && qt.test(n[r]); ) r--;
|
|
167
167
|
const u = n.slice(r + 1, f + 1);
|
|
168
168
|
if (!u) return null;
|
|
169
169
|
let a = s;
|
|
170
170
|
for (; a > 0 && /[\w$'"]/.test(n[a - 1]); ) a--;
|
|
171
171
|
const d = n.slice(a, s);
|
|
172
|
-
let
|
|
173
|
-
return d && (d[0] === "'" || d[0] === '"') && (
|
|
172
|
+
let T = d, D = null;
|
|
173
|
+
return d && (d[0] === "'" || d[0] === '"') && (D = d[0], T = d.slice(1)), {
|
|
174
174
|
functionName: u,
|
|
175
175
|
paramIndex: i.commas,
|
|
176
|
-
prefix:
|
|
176
|
+
prefix: T,
|
|
177
177
|
replaceStart: a,
|
|
178
|
-
quote:
|
|
178
|
+
quote: D
|
|
179
179
|
};
|
|
180
180
|
}
|
|
181
|
-
const
|
|
181
|
+
const Je = [
|
|
182
182
|
"break",
|
|
183
183
|
"case",
|
|
184
184
|
"catch",
|
|
@@ -223,7 +223,7 @@ const Pe = [
|
|
|
223
223
|
"undefined",
|
|
224
224
|
"NaN",
|
|
225
225
|
"Infinity"
|
|
226
|
-
],
|
|
226
|
+
], Zt = [
|
|
227
227
|
"abstract",
|
|
228
228
|
"any",
|
|
229
229
|
"as",
|
|
@@ -253,23 +253,23 @@ const Pe = [
|
|
|
253
253
|
"type",
|
|
254
254
|
"unknown"
|
|
255
255
|
];
|
|
256
|
-
function
|
|
257
|
-
return n === "typescript" ? [...
|
|
256
|
+
function rt(n) {
|
|
257
|
+
return n === "typescript" ? [...Je, ...Zt] : Je;
|
|
258
258
|
}
|
|
259
|
-
function
|
|
260
|
-
return new Set(
|
|
259
|
+
function Ge(n) {
|
|
260
|
+
return new Set(rt(n));
|
|
261
261
|
}
|
|
262
|
-
const
|
|
263
|
-
function
|
|
264
|
-
const o = n.slice(0, s), e =
|
|
262
|
+
const Ut = /((?:[A-Za-z_$][\w$]*\??\.)*)([A-Za-z_$][\w$]*)?$/, Qe = /\b(?:const|let|var|function|class)\s+([A-Za-z_$][\w$]*)/g, Yt = /^[A-Za-z_$]/;
|
|
263
|
+
function ct(n, s) {
|
|
264
|
+
const o = n.slice(0, s), e = Ut.exec(o);
|
|
265
265
|
if (!e) return { prefix: "", chain: [] };
|
|
266
266
|
const i = e[1] ?? "", r = e[2] ?? "", f = i.split(".").filter(Boolean).map((u) => u.replace(/\?$/, ""));
|
|
267
267
|
return { prefix: r, chain: f };
|
|
268
268
|
}
|
|
269
|
-
function
|
|
269
|
+
function et(n, s) {
|
|
270
270
|
const o = [], e = /* @__PURE__ */ new Set();
|
|
271
271
|
let i;
|
|
272
|
-
for (
|
|
272
|
+
for (Qe.lastIndex = 0; (i = Qe.exec(n)) && !(i.index >= s); ) {
|
|
273
273
|
const r = i[1];
|
|
274
274
|
if (e.has(r)) continue;
|
|
275
275
|
e.add(r);
|
|
@@ -282,7 +282,7 @@ function Ke(n, s) {
|
|
|
282
282
|
}
|
|
283
283
|
return o;
|
|
284
284
|
}
|
|
285
|
-
function
|
|
285
|
+
function ut(n, s) {
|
|
286
286
|
let o = s;
|
|
287
287
|
for (const e of n) {
|
|
288
288
|
if (!o) return null;
|
|
@@ -292,7 +292,7 @@ function nt(n, s) {
|
|
|
292
292
|
}
|
|
293
293
|
return o;
|
|
294
294
|
}
|
|
295
|
-
function
|
|
295
|
+
function Xt(n, s) {
|
|
296
296
|
const o = n.toLowerCase(), e = s.toLowerCase(), i = o.indexOf(e);
|
|
297
297
|
if (i === 0) return 1e3 - o.length;
|
|
298
298
|
if (i > 0) return 800 - i;
|
|
@@ -301,60 +301,60 @@ function qt(n, s) {
|
|
|
301
301
|
o[a] === e[r] && (u >= 0 && (f += a - u - 1), u = a, r++);
|
|
302
302
|
return r !== e.length ? null : 400 - f - o.length;
|
|
303
303
|
}
|
|
304
|
-
function
|
|
304
|
+
function dt(n, s) {
|
|
305
305
|
if (!s) return n;
|
|
306
306
|
const o = [];
|
|
307
307
|
for (const e of n) {
|
|
308
|
-
const i =
|
|
308
|
+
const i = Xt(e.label, s);
|
|
309
309
|
i !== null && o.push({ item: e, score: i });
|
|
310
310
|
}
|
|
311
311
|
return o.sort((e, i) => i.score - e.score || e.item.label.localeCompare(i.item.label)), o.map((e) => e.item);
|
|
312
312
|
}
|
|
313
|
-
function
|
|
313
|
+
function Jt(n) {
|
|
314
314
|
const s = /* @__PURE__ */ new Set(), o = [];
|
|
315
315
|
for (const e of n)
|
|
316
316
|
s.has(e.label) || (s.add(e.label), o.push(e));
|
|
317
317
|
return o;
|
|
318
318
|
}
|
|
319
|
-
function
|
|
320
|
-
const { prefix: e, chain: i } =
|
|
321
|
-
if (o.auto && (!e && i.length === 0 || e && !
|
|
319
|
+
function Gt(n, s, o) {
|
|
320
|
+
const { prefix: e, chain: i } = ct(n, s);
|
|
321
|
+
if (o.auto && (!e && i.length === 0 || e && !Yt.test(e)))
|
|
322
322
|
return null;
|
|
323
323
|
const r = o.declared ?? [], f = [...r, ...o.completions];
|
|
324
324
|
let u;
|
|
325
325
|
if (i.length > 0) {
|
|
326
|
-
const d =
|
|
326
|
+
const d = ut(i, f);
|
|
327
327
|
if (!d || d.length === 0) return null;
|
|
328
328
|
u = d;
|
|
329
329
|
} else
|
|
330
330
|
u = [
|
|
331
331
|
...o.completions,
|
|
332
332
|
...r,
|
|
333
|
-
...
|
|
333
|
+
...rt(o.language).map((d) => ({
|
|
334
334
|
label: d,
|
|
335
335
|
kind: "keyword"
|
|
336
336
|
}))
|
|
337
337
|
];
|
|
338
|
-
const a =
|
|
338
|
+
const a = dt(Jt(u), e);
|
|
339
339
|
return a.length === 0 ? null : {
|
|
340
340
|
items: a,
|
|
341
341
|
start: s - e.length,
|
|
342
342
|
end: s
|
|
343
343
|
};
|
|
344
344
|
}
|
|
345
|
-
const
|
|
346
|
-
function
|
|
345
|
+
const Qt = /([A-Za-z_$][\w$]*(?:\??\.[A-Za-z_$][\w$]*)*)\??\.\s*$/;
|
|
346
|
+
function en(n, s, o, e) {
|
|
347
347
|
const i = n.slice(s, o);
|
|
348
348
|
if (!i) return null;
|
|
349
|
-
const r = [...e.declared ?? [], ...e.completions], f =
|
|
349
|
+
const r = [...e.declared ?? [], ...e.completions], f = Qt.exec(n.slice(0, s));
|
|
350
350
|
if (f) {
|
|
351
|
-
const u = f[1].split(".").filter(Boolean).map((
|
|
351
|
+
const u = f[1].split(".").filter(Boolean).map((T) => T.replace(/\?$/, "")), a = ut(u, r), d = a == null ? void 0 : a.find((T) => T.label === i);
|
|
352
352
|
if (d) return d;
|
|
353
353
|
}
|
|
354
354
|
return r.find((u) => u.label === i) ?? null;
|
|
355
355
|
}
|
|
356
|
-
const Z = "[A-Za-z_$][\\w$]*",
|
|
357
|
-
function
|
|
356
|
+
const Z = "[A-Za-z_$][\\w$]*", tt = "(?:readonly\\s+|public\\s+|private\\s+|protected\\s+|static\\s+|abstract\\s+)*";
|
|
357
|
+
function nt(n, s) {
|
|
358
358
|
let o = 0, e = !1, i = s;
|
|
359
359
|
for (let r = s; r < n.length; r++) {
|
|
360
360
|
const f = n[r];
|
|
@@ -369,23 +369,23 @@ function Ue(n, s) {
|
|
|
369
369
|
}
|
|
370
370
|
return { end: i, body: n.slice(s + 1, i) };
|
|
371
371
|
}
|
|
372
|
-
function
|
|
372
|
+
function lt(n) {
|
|
373
373
|
return n.trim().replace(/[,;]$/, "").trim();
|
|
374
374
|
}
|
|
375
|
-
function
|
|
375
|
+
function tn(n) {
|
|
376
376
|
return /^(?:export\s+)?(?:declare\s+)?(?:abstract\s+)?(?:interface|class|type|function|const|let|var|namespace|enum)\b/.test(
|
|
377
377
|
n
|
|
378
378
|
);
|
|
379
379
|
}
|
|
380
|
-
function
|
|
380
|
+
function oe(n, s) {
|
|
381
381
|
const o = n[s];
|
|
382
382
|
let e = o.lastIndexOf("}");
|
|
383
383
|
const i = o.lastIndexOf(";");
|
|
384
384
|
if (i > e && (e = i), e === -1) return;
|
|
385
385
|
const r = o.slice(e + 1).replace(/^[\s;]+/, "").trim();
|
|
386
|
-
!r || !
|
|
386
|
+
!r || !tn(r) || (n[s] = o.slice(0, e + 1), n.splice(s + 1, 0, r));
|
|
387
387
|
}
|
|
388
|
-
function
|
|
388
|
+
function J(n) {
|
|
389
389
|
return n.length ? n.join(`
|
|
390
390
|
`).replace(/^\s*\/\*\*?/, "").replace(/\*\/\s*$/, "").split(`
|
|
391
391
|
`).map((s) => s.replace(/^\s*\*+\s?/, "").replace(/^\s*\/\/\s?/, "")).join(`
|
|
@@ -393,14 +393,14 @@ function G(n) {
|
|
|
393
393
|
|
|
394
394
|
`).trim() : "";
|
|
395
395
|
}
|
|
396
|
-
function
|
|
396
|
+
function it(n) {
|
|
397
397
|
return n.split(`
|
|
398
398
|
`).filter((s) => !/^\s*(\/\/|\/\*|\*)/.test(s)).join(`
|
|
399
399
|
`).replace(/\n{2,}/g, `
|
|
400
400
|
`).trim();
|
|
401
401
|
}
|
|
402
|
-
function
|
|
403
|
-
const s = [], o = /* @__PURE__ */ new Set(), e = new RegExp(`^${
|
|
402
|
+
function ot(n) {
|
|
403
|
+
const s = [], o = /* @__PURE__ */ new Set(), e = new RegExp(`^${tt}(${Z})(\\?)?\\s*\\((.*)\\)\\s*:\\s*(.+?);?$`), i = new RegExp(`^${tt}(${Z})(\\?)?\\s*:\\s*(.+?);?$`);
|
|
404
404
|
let r = [], f = !1;
|
|
405
405
|
for (const u of n) {
|
|
406
406
|
const a = u.trim();
|
|
@@ -422,44 +422,44 @@ function Je(n) {
|
|
|
422
422
|
}
|
|
423
423
|
const d = e.exec(a);
|
|
424
424
|
if (d) {
|
|
425
|
-
const
|
|
425
|
+
const D = J(r);
|
|
426
426
|
r = [];
|
|
427
427
|
const S = d[1];
|
|
428
428
|
if (o.has(S)) continue;
|
|
429
429
|
o.add(S), s.push({
|
|
430
430
|
label: S,
|
|
431
431
|
kind: "function",
|
|
432
|
-
detail: `(${d[3].trim()}) => ${
|
|
433
|
-
documentation:
|
|
432
|
+
detail: `(${d[3].trim()}) => ${lt(d[4])}`,
|
|
433
|
+
documentation: D || void 0
|
|
434
434
|
});
|
|
435
435
|
continue;
|
|
436
436
|
}
|
|
437
|
-
const
|
|
438
|
-
if (
|
|
439
|
-
const
|
|
437
|
+
const T = i.exec(a);
|
|
438
|
+
if (T) {
|
|
439
|
+
const D = J(r);
|
|
440
440
|
r = [];
|
|
441
|
-
const S =
|
|
441
|
+
const S = T[1];
|
|
442
442
|
if (o.has(S)) continue;
|
|
443
443
|
o.add(S);
|
|
444
|
-
const b =
|
|
444
|
+
const b = lt(T[3]), v = /^\(|=>/.test(b) ? "function" : "property";
|
|
445
445
|
s.push({
|
|
446
446
|
label: S,
|
|
447
447
|
kind: v,
|
|
448
448
|
detail: b,
|
|
449
|
-
documentation:
|
|
449
|
+
documentation: D || void 0
|
|
450
450
|
});
|
|
451
451
|
}
|
|
452
452
|
}
|
|
453
453
|
return s;
|
|
454
454
|
}
|
|
455
|
-
function
|
|
455
|
+
function ft(n) {
|
|
456
456
|
const s = [], o = /(['"])((?:\\.|(?!\1).)*)\1/g;
|
|
457
457
|
let e;
|
|
458
458
|
for (; e = o.exec(n); )
|
|
459
459
|
s.push(e[2]);
|
|
460
460
|
return s;
|
|
461
461
|
}
|
|
462
|
-
function
|
|
462
|
+
function nn(n, s) {
|
|
463
463
|
const o = [];
|
|
464
464
|
let e = 0, i = "", r = null;
|
|
465
465
|
for (let f = 0; f < n.length; f++) {
|
|
@@ -480,15 +480,15 @@ function Jt(n, s) {
|
|
|
480
480
|
}
|
|
481
481
|
return o.push(i), o;
|
|
482
482
|
}
|
|
483
|
-
function
|
|
484
|
-
const o = n.trim(), e =
|
|
483
|
+
function ln(n, s) {
|
|
484
|
+
const o = n.trim(), e = ft(o);
|
|
485
485
|
if (e.length) return e;
|
|
486
486
|
const i = s.get(o.replace(/\[\]$/, ""));
|
|
487
487
|
return (i == null ? void 0 : i.literals) ?? [];
|
|
488
488
|
}
|
|
489
|
-
function
|
|
489
|
+
function on(n, s) {
|
|
490
490
|
const o = n.trim();
|
|
491
|
-
return o ?
|
|
491
|
+
return o ? nn(o, ",").map((e) => {
|
|
492
492
|
const i = new RegExp(`^\\s*(${Z})\\s*(\\?)?\\s*:\\s*(.+)$`).exec(e);
|
|
493
493
|
if (!i)
|
|
494
494
|
return { name: e.trim(), type: "", optional: !1, literals: [] };
|
|
@@ -497,52 +497,52 @@ function Qt(n, s) {
|
|
|
497
497
|
name: i[1],
|
|
498
498
|
optional: !!i[2],
|
|
499
499
|
type: r,
|
|
500
|
-
literals:
|
|
500
|
+
literals: ln(r, s)
|
|
501
501
|
};
|
|
502
502
|
}) : [];
|
|
503
503
|
}
|
|
504
|
-
function
|
|
504
|
+
function pt(n) {
|
|
505
505
|
const s = n.replace(/\[\]/g, "").replace(/<[^>]*>/g, "").replace(/\s*\|\s*null\s*/g, "").trim(), o = new RegExp(`^(${Z})$`).exec(s);
|
|
506
506
|
return o ? o[1] : null;
|
|
507
507
|
}
|
|
508
|
-
function
|
|
508
|
+
function an(n) {
|
|
509
509
|
const s = n.trim();
|
|
510
510
|
if (!s || s.endsWith(";")) return !1;
|
|
511
511
|
const o = (s.match(/[(<[{]/g) ?? []).length, e = (s.match(/[)>\]}]/g) ?? []).length;
|
|
512
512
|
return /[|&,(<]\s*$/.test(s) || o > e;
|
|
513
513
|
}
|
|
514
|
-
function
|
|
514
|
+
function mt(n, s, o, e = 0) {
|
|
515
515
|
return e > 6 ? n : n.map((i) => {
|
|
516
516
|
if (i.kind !== "property" || !i.detail) return i;
|
|
517
|
-
const r =
|
|
517
|
+
const r = pt(i.detail), f = r ? s.get(r) : void 0;
|
|
518
518
|
if (!f || o.has(f.label)) return i;
|
|
519
519
|
const u = new Set(o);
|
|
520
520
|
return u.add(f.label), {
|
|
521
521
|
...i,
|
|
522
522
|
type: f.type,
|
|
523
|
-
members:
|
|
523
|
+
members: mt(f.members, s, u, e + 1)
|
|
524
524
|
};
|
|
525
525
|
});
|
|
526
526
|
}
|
|
527
|
-
const
|
|
528
|
-
function
|
|
529
|
-
if (!n || !n.trim()) return
|
|
530
|
-
const s =
|
|
527
|
+
const sn = 50, ae = /* @__PURE__ */ new Map(), rn = { items: [], signatures: /* @__PURE__ */ new Map() };
|
|
528
|
+
function ht(n) {
|
|
529
|
+
if (!n || !n.trim()) return rn;
|
|
530
|
+
const s = ae.get(n);
|
|
531
531
|
if (s) return s;
|
|
532
|
-
const o =
|
|
533
|
-
if (
|
|
534
|
-
const e =
|
|
535
|
-
e !== void 0 &&
|
|
532
|
+
const o = dn(n);
|
|
533
|
+
if (ae.size >= sn) {
|
|
534
|
+
const e = ae.keys().next().value;
|
|
535
|
+
e !== void 0 && ae.delete(e);
|
|
536
536
|
}
|
|
537
|
-
return
|
|
537
|
+
return ae.set(n, o), o;
|
|
538
538
|
}
|
|
539
|
-
function
|
|
540
|
-
return
|
|
539
|
+
function cn(n) {
|
|
540
|
+
return ht(n).items;
|
|
541
541
|
}
|
|
542
|
-
function
|
|
543
|
-
return
|
|
542
|
+
function un(n) {
|
|
543
|
+
return ht(n).signatures;
|
|
544
544
|
}
|
|
545
|
-
function
|
|
545
|
+
function dn(n) {
|
|
546
546
|
const s = n.split(`
|
|
547
547
|
`), o = /* @__PURE__ */ new Map(), e = /* @__PURE__ */ new Map(), i = new RegExp(`^(?:export\\s+)?(?:declare\\s+)?interface\\s+(${Z})`), r = new RegExp(`^(?:export\\s+)?(?:declare\\s+)?(?:abstract\\s+)?class\\s+(${Z})`), f = new RegExp(`^(?:export\\s+)?(?:declare\\s+)?type\\s+(${Z})\\s*=`);
|
|
548
548
|
let u = [], a = !1;
|
|
@@ -566,62 +566,62 @@ function an(n) {
|
|
|
566
566
|
}
|
|
567
567
|
const W = i.exec(v);
|
|
568
568
|
if (W && v.includes("{")) {
|
|
569
|
-
const w =
|
|
569
|
+
const w = J(u);
|
|
570
570
|
u = [];
|
|
571
|
-
const { end:
|
|
571
|
+
const { end: $, body: _ } = nt(s, b), g = W[1];
|
|
572
572
|
o.set(g, {
|
|
573
573
|
label: g,
|
|
574
|
-
type:
|
|
575
|
-
s.slice(b,
|
|
574
|
+
type: it(
|
|
575
|
+
s.slice(b, $ + 1).join(`
|
|
576
576
|
`).replace(/^\s*export\s+/, "")
|
|
577
577
|
),
|
|
578
|
-
members:
|
|
578
|
+
members: ot(_),
|
|
579
579
|
kind: "interface",
|
|
580
580
|
documentation: w || void 0
|
|
581
|
-
}),
|
|
581
|
+
}), oe(s, $), b = $;
|
|
582
582
|
continue;
|
|
583
583
|
}
|
|
584
584
|
const O = r.exec(v);
|
|
585
585
|
if (O && v.includes("{")) {
|
|
586
|
-
const w =
|
|
586
|
+
const w = J(u);
|
|
587
587
|
u = [];
|
|
588
|
-
const { end:
|
|
588
|
+
const { end: $, body: _ } = nt(s, b), g = O[1];
|
|
589
589
|
o.set(g, {
|
|
590
590
|
label: g,
|
|
591
|
-
type:
|
|
592
|
-
s.slice(b,
|
|
591
|
+
type: it(
|
|
592
|
+
s.slice(b, $ + 1).join(`
|
|
593
593
|
`).replace(/^\s*export\s+/, "")
|
|
594
594
|
),
|
|
595
|
-
members:
|
|
595
|
+
members: ot(_),
|
|
596
596
|
kind: "class",
|
|
597
597
|
documentation: w || void 0
|
|
598
|
-
}),
|
|
598
|
+
}), oe(s, $), b = $;
|
|
599
599
|
continue;
|
|
600
600
|
}
|
|
601
|
-
const
|
|
602
|
-
if (
|
|
603
|
-
const w =
|
|
601
|
+
const R = f.exec(v);
|
|
602
|
+
if (R) {
|
|
603
|
+
const w = J(u);
|
|
604
604
|
u = [];
|
|
605
|
-
const
|
|
606
|
-
let
|
|
607
|
-
for (;
|
|
608
|
-
`)) &&
|
|
609
|
-
|
|
610
|
-
const g =
|
|
605
|
+
const $ = [s[b]];
|
|
606
|
+
let _ = b;
|
|
607
|
+
for (; an($.join(`
|
|
608
|
+
`)) && _ + 1 < s.length; )
|
|
609
|
+
_++, $.push(s[_]);
|
|
610
|
+
const g = $.join(`
|
|
611
611
|
`).replace(/^\s*export\s+/, "").replace(/;\s*$/, "").trim();
|
|
612
|
-
o.set(
|
|
613
|
-
label:
|
|
612
|
+
o.set(R[1], {
|
|
613
|
+
label: R[1],
|
|
614
614
|
type: g,
|
|
615
615
|
members: [],
|
|
616
616
|
kind: "type",
|
|
617
617
|
documentation: w || void 0,
|
|
618
|
-
literals:
|
|
619
|
-
}),
|
|
618
|
+
literals: ft(g)
|
|
619
|
+
}), oe(s, _), b = _;
|
|
620
620
|
continue;
|
|
621
621
|
}
|
|
622
622
|
u = [];
|
|
623
623
|
}
|
|
624
|
-
const d = [],
|
|
624
|
+
const d = [], T = /* @__PURE__ */ new Set(), D = new RegExp(
|
|
625
625
|
`^(?:export\\s+)?(?:declare\\s+)?function\\s+(${Z})\\s*\\(([^)]*)\\)\\s*:\\s*([^;{]+)`
|
|
626
626
|
), S = new RegExp(
|
|
627
627
|
`^(?:export\\s+)?(?:declare\\s+)?(?:const|let|var)\\s+(${Z})\\s*:\\s*([^=;]+)`
|
|
@@ -645,36 +645,36 @@ function an(n) {
|
|
|
645
645
|
u = [];
|
|
646
646
|
continue;
|
|
647
647
|
}
|
|
648
|
-
const W =
|
|
648
|
+
const W = D.exec(v);
|
|
649
649
|
if (W) {
|
|
650
|
-
|
|
651
|
-
const
|
|
650
|
+
oe(s, b);
|
|
651
|
+
const R = J(u);
|
|
652
652
|
u = [];
|
|
653
653
|
const w = W[1];
|
|
654
|
-
|
|
654
|
+
T.has(w) || (T.add(w), d.push({
|
|
655
655
|
label: w,
|
|
656
656
|
kind: "function",
|
|
657
657
|
detail: `(${W[2].trim()}) => ${W[3].trim()}`,
|
|
658
|
-
documentation:
|
|
659
|
-
})), e.set(w, { name: w, params:
|
|
658
|
+
documentation: R || void 0
|
|
659
|
+
})), e.set(w, { name: w, params: on(W[2], o) });
|
|
660
660
|
continue;
|
|
661
661
|
}
|
|
662
662
|
const O = S.exec(v);
|
|
663
663
|
if (O) {
|
|
664
|
-
|
|
665
|
-
const
|
|
664
|
+
oe(s, b);
|
|
665
|
+
const R = J(u);
|
|
666
666
|
u = [];
|
|
667
667
|
const w = O[1];
|
|
668
|
-
if (
|
|
669
|
-
|
|
670
|
-
const
|
|
668
|
+
if (T.has(w)) continue;
|
|
669
|
+
T.add(w);
|
|
670
|
+
const $ = O[2].trim(), _ = pt($), g = _ ? o.get(_) : void 0, se = (g == null ? void 0 : g.kind) === "class" ? "class" : /^\(|=>/.test($) ? "function" : "variable";
|
|
671
671
|
d.push({
|
|
672
672
|
label: w,
|
|
673
|
-
kind:
|
|
674
|
-
detail:
|
|
673
|
+
kind: se,
|
|
674
|
+
detail: $,
|
|
675
675
|
type: g == null ? void 0 : g.type,
|
|
676
|
-
documentation:
|
|
677
|
-
members: g ?
|
|
676
|
+
documentation: R || (g == null ? void 0 : g.documentation) || void 0,
|
|
677
|
+
members: g ? mt(g.members, o, /* @__PURE__ */ new Set([g.label])) : void 0
|
|
678
678
|
});
|
|
679
679
|
continue;
|
|
680
680
|
}
|
|
@@ -682,7 +682,7 @@ function an(n) {
|
|
|
682
682
|
}
|
|
683
683
|
return { items: d, signatures: e };
|
|
684
684
|
}
|
|
685
|
-
function
|
|
685
|
+
function Me(n, s, o, e) {
|
|
686
686
|
if (!o || !e) return null;
|
|
687
687
|
const i = Math.max(0, s - 1), r = n.lastIndexOf(o, i);
|
|
688
688
|
if (r === -1 || n.lastIndexOf(e, i) > r) return null;
|
|
@@ -692,16 +692,16 @@ function we(n, s, o, e) {
|
|
|
692
692
|
end: u === -1 ? n.length : u
|
|
693
693
|
};
|
|
694
694
|
}
|
|
695
|
-
function
|
|
696
|
-
return
|
|
695
|
+
function Bn(n, s, o, e) {
|
|
696
|
+
return Me(n, s, o, e) !== null;
|
|
697
697
|
}
|
|
698
|
-
const
|
|
699
|
-
function
|
|
698
|
+
const at = /[A-Za-z_$]/, fn = /[\w$]/, st = /\s/;
|
|
699
|
+
function ge(n, s) {
|
|
700
700
|
const o = [], e = n.length;
|
|
701
701
|
let i = 0;
|
|
702
702
|
for (; i < e; ) {
|
|
703
703
|
const r = n[i], f = n[i + 1];
|
|
704
|
-
if (
|
|
704
|
+
if (st.test(r)) {
|
|
705
705
|
i++;
|
|
706
706
|
continue;
|
|
707
707
|
}
|
|
@@ -756,87 +756,87 @@ function ue(n, s) {
|
|
|
756
756
|
o.push({ start: i, end: a, type: "number" }), i = a;
|
|
757
757
|
continue;
|
|
758
758
|
}
|
|
759
|
-
if (
|
|
759
|
+
if (at.test(r)) {
|
|
760
760
|
let a = i + 1;
|
|
761
|
-
for (; a < e &&
|
|
762
|
-
const d = n.slice(i, a),
|
|
763
|
-
o.push({ start: i, end: a, type:
|
|
761
|
+
for (; a < e && fn.test(n[a]); ) a++;
|
|
762
|
+
const d = n.slice(i, a), T = s.keywords.has(d) ? "keyword" : s.builtins.has(d) ? "builtin" : "identifier";
|
|
763
|
+
o.push({ start: i, end: a, type: T }), i = a;
|
|
764
764
|
continue;
|
|
765
765
|
}
|
|
766
766
|
let u = i + 1;
|
|
767
767
|
for (; u < e; ) {
|
|
768
768
|
const a = n[u];
|
|
769
|
-
if (
|
|
769
|
+
if (st.test(a) || at.test(a) || /[0-9]/.test(a) || a === '"' || a === "'" || a === "`" || a === "/") break;
|
|
770
770
|
u++;
|
|
771
771
|
}
|
|
772
772
|
o.push({ start: i, end: u, type: "punctuation" }), i = u;
|
|
773
773
|
}
|
|
774
774
|
return o;
|
|
775
775
|
}
|
|
776
|
-
const
|
|
776
|
+
const pn = {
|
|
777
777
|
"&": "&",
|
|
778
778
|
"<": "<",
|
|
779
779
|
">": ">"
|
|
780
780
|
};
|
|
781
|
-
function
|
|
782
|
-
return n.replace(/[&<>]/g, (s) =>
|
|
781
|
+
function G(n) {
|
|
782
|
+
return n.replace(/[&<>]/g, (s) => pn[s] ?? s);
|
|
783
783
|
}
|
|
784
|
-
function
|
|
784
|
+
function be(n, s, o = 0) {
|
|
785
785
|
let e = "", i = 0;
|
|
786
786
|
for (const r of s) {
|
|
787
|
-
r.start > i && (e +=
|
|
788
|
-
const f =
|
|
787
|
+
r.start > i && (e += G(n.slice(i, r.start)));
|
|
788
|
+
const f = G(n.slice(r.start, r.end));
|
|
789
789
|
e += `<span class="tok-${r.type}" data-start="${r.start + o}" data-end="${r.end + o}">${f}</span>`, i = r.end;
|
|
790
790
|
}
|
|
791
|
-
return i < n.length && (e +=
|
|
791
|
+
return i < n.length && (e += G(n.slice(i))), e;
|
|
792
792
|
}
|
|
793
|
-
function
|
|
794
|
-
if (!o || !e) return
|
|
793
|
+
function mn(n, s, o, e) {
|
|
794
|
+
if (!o || !e) return be(n, ge(n, s));
|
|
795
795
|
let i = "", r = 0;
|
|
796
796
|
for (; r < n.length; ) {
|
|
797
797
|
const f = n.indexOf(o, r);
|
|
798
798
|
if (f === -1) {
|
|
799
|
-
i +=
|
|
799
|
+
i += G(n.slice(r));
|
|
800
800
|
break;
|
|
801
801
|
}
|
|
802
|
-
i +=
|
|
802
|
+
i += G(n.slice(r, f));
|
|
803
803
|
const u = n.indexOf(e, f + o.length), a = u === -1 ? n.length : u, d = n.slice(f + o.length, a);
|
|
804
|
-
i += `<span class="tok-brace">${
|
|
804
|
+
i += `<span class="tok-brace">${G(o)}</span>`, i += be(d, ge(d, s), f + o.length), u === -1 ? r = a : (i += `<span class="tok-brace">${G(e)}</span>`, r = u + e.length);
|
|
805
805
|
}
|
|
806
806
|
return i;
|
|
807
807
|
}
|
|
808
|
-
const
|
|
808
|
+
const hn = {
|
|
809
809
|
key: 0,
|
|
810
810
|
class: "gutter",
|
|
811
811
|
"aria-hidden": "true"
|
|
812
|
-
},
|
|
812
|
+
}, gn = ["innerHTML"], bn = ["value", "readonly", "placeholder"], vn = ["onMouseenter", "onClick"], yn = { class: "popup-label" }, kn = {
|
|
813
813
|
key: 0,
|
|
814
814
|
class: "popup-detail"
|
|
815
|
-
},
|
|
815
|
+
}, wn = { class: "hover-head" }, xn = { class: "hover-name" }, Tn = {
|
|
816
816
|
key: 0,
|
|
817
817
|
class: "hover-colon"
|
|
818
|
-
},
|
|
818
|
+
}, $n = {
|
|
819
819
|
key: 0,
|
|
820
820
|
class: "hover-type"
|
|
821
|
-
},
|
|
821
|
+
}, Cn = {
|
|
822
822
|
key: 0,
|
|
823
823
|
class: "hover-doc"
|
|
824
|
-
},
|
|
824
|
+
}, Sn = {
|
|
825
825
|
key: 1,
|
|
826
826
|
class: "hover-def"
|
|
827
|
-
},
|
|
827
|
+
}, En = ["innerHTML"], Rn = ["title", "aria-label"], Mn = {
|
|
828
828
|
key: 0,
|
|
829
829
|
viewBox: "0 0 16 16",
|
|
830
830
|
width: "14",
|
|
831
831
|
height: "14",
|
|
832
832
|
"aria-hidden": "true"
|
|
833
|
-
},
|
|
833
|
+
}, In = {
|
|
834
834
|
key: 1,
|
|
835
835
|
viewBox: "0 0 16 16",
|
|
836
836
|
width: "14",
|
|
837
837
|
height: "14",
|
|
838
838
|
"aria-hidden": "true"
|
|
839
|
-
},
|
|
839
|
+
}, Hn = /* @__PURE__ */ Dt({
|
|
840
840
|
__name: "CodeEditor",
|
|
841
841
|
props: {
|
|
842
842
|
modelValue: {},
|
|
@@ -886,77 +886,77 @@ const un = {
|
|
|
886
886
|
"End",
|
|
887
887
|
"PageUp",
|
|
888
888
|
"PageDown"
|
|
889
|
-
]), a =
|
|
890
|
-
() => e.tsTypes ?
|
|
891
|
-
),
|
|
892
|
-
() => e.tsTypes ?
|
|
893
|
-
),
|
|
894
|
-
...
|
|
895
|
-
...
|
|
889
|
+
]), a = E(e.modelValue), d = E(), T = E(), D = E(), S = E(), b = E(), v = E(), W = E(), O = E([]), R = E(0), w = E(!1), $ = E({ start: 0, end: 0 }), _ = E({}), g = E(null), se = E({}), gt = q(
|
|
890
|
+
() => e.tsTypes ? cn(e.tsTypes) : []
|
|
891
|
+
), bt = q(
|
|
892
|
+
() => e.tsTypes ? un(e.tsTypes) : /* @__PURE__ */ new Map()
|
|
893
|
+
), Ie = q(() => [
|
|
894
|
+
...Vt,
|
|
895
|
+
...gt.value,
|
|
896
896
|
...e.completions
|
|
897
|
-
]),
|
|
898
|
-
() => e.mode === "template" ? [...e.templateCompletions, ...
|
|
899
|
-
),
|
|
897
|
+
]), ve = q(
|
|
898
|
+
() => e.mode === "template" ? [...e.templateCompletions, ...Ie.value] : Ie.value
|
|
899
|
+
), vt = q(() => {
|
|
900
900
|
const t = {
|
|
901
|
-
keywords:
|
|
902
|
-
builtins: new Set(
|
|
901
|
+
keywords: Ge(e.language),
|
|
902
|
+
builtins: new Set(ve.value.map((l) => l.label))
|
|
903
903
|
};
|
|
904
|
-
return e.mode === "template" ? `${
|
|
905
|
-
` : `${
|
|
904
|
+
return e.mode === "template" ? `${mn(a.value, t, e.templateOpen, e.templateClose)}
|
|
905
|
+
` : `${be(a.value, ge(a.value, t))}
|
|
906
906
|
`;
|
|
907
|
-
}),
|
|
908
|
-
`).length),
|
|
907
|
+
}), yt = q(() => a.value.split(`
|
|
908
|
+
`).length), P = E(e.defaultExpanded), ye = E(!1), re = q(() => e.collapsible && !P.value), kt = q(() => {
|
|
909
909
|
const t = {};
|
|
910
910
|
return e.collapsible && (t.height = e.collapsedHeight), t;
|
|
911
|
-
}),
|
|
911
|
+
}), wt = q(() => {
|
|
912
912
|
const t = {
|
|
913
913
|
"--ce-radius": e.borderRadius,
|
|
914
914
|
"--ce-collapsed-height": e.collapsedHeight
|
|
915
915
|
};
|
|
916
|
-
return e.background && (t["--ce-bg"] = e.background), e.borderColor && (t["--ce-border"] = e.borderColor), e.collapsible ? { ...t, height:
|
|
916
|
+
return e.background && (t["--ce-bg"] = e.background), e.borderColor && (t["--ce-border"] = e.borderColor), e.collapsible ? { ...t, height: P.value ? e.minHeight : e.collapsedHeight } : { ...t, height: e.minHeight };
|
|
917
917
|
});
|
|
918
|
-
let
|
|
919
|
-
function
|
|
920
|
-
if (
|
|
918
|
+
let He = 0;
|
|
919
|
+
function Le(t) {
|
|
920
|
+
if (P.value === t) return;
|
|
921
921
|
const l = d.value;
|
|
922
|
-
t && l && (
|
|
923
|
-
if (
|
|
922
|
+
t && l && (He = l.scrollTop), P.value = t, e.collapsible && (ye.value = !0), i(t ? "expand" : "collapse"), A(), F(), V(() => {
|
|
923
|
+
if (ke(), !P.value && l) {
|
|
924
924
|
const c = Math.max(0, l.scrollHeight - l.clientHeight);
|
|
925
|
-
l.scrollTop = Math.max(0, Math.min(
|
|
925
|
+
l.scrollTop = Math.max(0, Math.min(He, c)), j(!0), document.activeElement === l && X();
|
|
926
926
|
return;
|
|
927
927
|
}
|
|
928
|
-
|
|
928
|
+
j(!0), t && e.collapseOnBlur && l && document.activeElement !== l && l.focus();
|
|
929
929
|
});
|
|
930
930
|
}
|
|
931
|
-
function
|
|
932
|
-
|
|
931
|
+
function xt() {
|
|
932
|
+
ye.value = !1;
|
|
933
933
|
}
|
|
934
|
-
function
|
|
935
|
-
|
|
934
|
+
function Tt() {
|
|
935
|
+
Le(!P.value);
|
|
936
936
|
}
|
|
937
|
-
|
|
937
|
+
Ze(
|
|
938
938
|
() => e.modelValue,
|
|
939
939
|
(t) => {
|
|
940
|
-
t !== a.value && (a.value = t,
|
|
940
|
+
t !== a.value && (a.value = t, A());
|
|
941
941
|
}
|
|
942
|
-
),
|
|
943
|
-
|
|
942
|
+
), Ze(a, () => {
|
|
943
|
+
V(() => j(!0));
|
|
944
944
|
});
|
|
945
|
-
function
|
|
945
|
+
function _e(t) {
|
|
946
946
|
return r[t];
|
|
947
947
|
}
|
|
948
|
-
function
|
|
949
|
-
return t ?
|
|
948
|
+
function $t(t) {
|
|
949
|
+
return t ? be(
|
|
950
950
|
t,
|
|
951
|
-
|
|
951
|
+
ge(t, { keywords: Ge("typescript"), builtins: /* @__PURE__ */ new Set() })
|
|
952
952
|
) : "";
|
|
953
953
|
}
|
|
954
|
-
let
|
|
955
|
-
function
|
|
954
|
+
let Q = { top: 14, bottom: 14, left: 16, right: 16, lineHeight: 22 };
|
|
955
|
+
function ke() {
|
|
956
956
|
const t = d.value;
|
|
957
957
|
if (!t) return;
|
|
958
958
|
const l = window.getComputedStyle(t);
|
|
959
|
-
|
|
959
|
+
Q = {
|
|
960
960
|
top: parseFloat(l.paddingTop) || 0,
|
|
961
961
|
bottom: parseFloat(l.paddingBottom) || 0,
|
|
962
962
|
left: parseFloat(l.paddingLeft) || 0,
|
|
@@ -964,35 +964,39 @@ const un = {
|
|
|
964
964
|
lineHeight: parseFloat(l.lineHeight) || 22
|
|
965
965
|
};
|
|
966
966
|
}
|
|
967
|
-
function
|
|
967
|
+
function j(t = !1) {
|
|
968
968
|
const l = d.value;
|
|
969
969
|
if (!l) return;
|
|
970
970
|
const c = S.value;
|
|
971
971
|
if (c && (c.style.transform = `translate(${-l.scrollLeft}px, ${-l.scrollTop}px)`), b.value && (b.value.style.transform = `translateY(${-l.scrollTop}px)`), t) {
|
|
972
972
|
const p = `${a.value}|${e.mode}|${l.clientWidth}|${l.clientHeight}`;
|
|
973
|
-
p !==
|
|
973
|
+
p !== Be && (Be = p, Ct());
|
|
974
974
|
}
|
|
975
975
|
}
|
|
976
976
|
function X() {
|
|
977
977
|
const t = d.value;
|
|
978
978
|
if (!t) return;
|
|
979
|
-
const l =
|
|
979
|
+
const l = Oe();
|
|
980
980
|
if (!l) return;
|
|
981
|
-
const c = t.getBoundingClientRect(), p = t.offsetWidth ? c.width / t.offsetWidth : 1, h = t.offsetHeight ? c.height / t.offsetHeight : 1;
|
|
982
|
-
let
|
|
983
|
-
if (
|
|
984
|
-
const
|
|
985
|
-
|
|
981
|
+
const c = t.getBoundingClientRect(), p = t.offsetWidth ? c.width / t.offsetWidth : 1, h = t.offsetHeight ? c.height / t.offsetHeight : 1, m = t.clientHeight * h, x = Q.top * h, k = Q.bottom * h, y = l.lineHeight * h, C = t.scrollTop * h, M = Math.max(0, t.scrollHeight * h - m), z = (re.value ? 8 : 14) * h;
|
|
982
|
+
let I = t.scrollTop;
|
|
983
|
+
if (re.value) {
|
|
984
|
+
const me = m - x - k, le = l.top + C - x - Math.max(0, (me - y) / 2);
|
|
985
|
+
I = Math.max(0, Math.min(le, M)) / h;
|
|
986
|
+
} else {
|
|
987
|
+
const me = x, Ee = m - k, le = l.top, Ke = le + y;
|
|
988
|
+
let Re = C;
|
|
989
|
+
le < me + z ? Re = C + (le - me - z) : Ke > Ee - z && (Re = C + (Ke - Ee + z)), I = Math.max(0, Math.min(Re, M)) / h;
|
|
986
990
|
}
|
|
987
|
-
const
|
|
988
|
-
let
|
|
989
|
-
|
|
990
|
-
const
|
|
991
|
-
!
|
|
992
|
-
}
|
|
993
|
-
let
|
|
994
|
-
function
|
|
995
|
-
const t = d.value, l =
|
|
991
|
+
const N = t.clientWidth * p, te = Q.left * p, U = Q.right * p, Se = t.scrollLeft * p, de = l.left + Se, Wt = Se + te, zt = Se + N - U, fe = 8 * p;
|
|
992
|
+
let pe = t.scrollLeft;
|
|
993
|
+
de < Wt + fe ? pe = Math.max(0, (de - te - fe) / p) : de > zt - fe && (pe = Math.max(0, (de - te - N + U + fe) / p));
|
|
994
|
+
const Ve = Math.abs(I - t.scrollTop) > 0.5, qe = Math.abs(pe - t.scrollLeft) > 0.5;
|
|
995
|
+
!Ve && !qe || (Ve && (t.scrollTop = I), qe && (t.scrollLeft = pe), j());
|
|
996
|
+
}
|
|
997
|
+
let Ae = [], Be = "", ce = 0, we = -1, xe = -1, Te = { x: 0, y: 0 };
|
|
998
|
+
function Ct() {
|
|
999
|
+
const t = d.value, l = D.value;
|
|
996
1000
|
if (!t || !l) return;
|
|
997
1001
|
const c = t.getBoundingClientRect(), p = [];
|
|
998
1002
|
l.querySelectorAll("[data-start]").forEach((h) => {
|
|
@@ -1005,32 +1009,32 @@ const un = {
|
|
|
1005
1009
|
top: m.top - c.top + t.scrollTop,
|
|
1006
1010
|
bottom: m.bottom - c.top + t.scrollTop
|
|
1007
1011
|
});
|
|
1008
|
-
}),
|
|
1012
|
+
}), Ae = p;
|
|
1009
1013
|
}
|
|
1010
|
-
function
|
|
1011
|
-
for (const c of
|
|
1014
|
+
function St(t, l) {
|
|
1015
|
+
for (const c of Ae)
|
|
1012
1016
|
if (t >= c.left - 1 && t <= c.right + 1 && l >= c.top && l <= c.bottom)
|
|
1013
1017
|
return c;
|
|
1014
1018
|
return null;
|
|
1015
1019
|
}
|
|
1016
|
-
function
|
|
1017
|
-
g.value = null,
|
|
1020
|
+
function F() {
|
|
1021
|
+
g.value = null, ce = 0, we = -1, xe = -1;
|
|
1018
1022
|
}
|
|
1019
|
-
function
|
|
1023
|
+
function Et(t) {
|
|
1020
1024
|
const l = W.value, c = d.value;
|
|
1021
1025
|
if (!l || !c) return;
|
|
1022
|
-
const p = c.getBoundingClientRect(), h = p.left + t.left - c.scrollLeft, m = p.left + t.right - c.scrollLeft, x = p.top + t.top - c.scrollTop, k = p.top + t.bottom - c.scrollTop, y = 12, C = 8,
|
|
1023
|
-
let
|
|
1024
|
-
|
|
1026
|
+
const p = c.getBoundingClientRect(), h = p.left + t.left - c.scrollLeft, m = p.left + t.right - c.scrollLeft, x = p.top + t.top - c.scrollTop, k = p.top + t.bottom - c.scrollTop, y = 12, C = 8, M = l.offsetWidth, z = l.offsetHeight;
|
|
1027
|
+
let I = h, N = k + C;
|
|
1028
|
+
I + M > window.innerWidth - y && (I = m - M), N + z > window.innerHeight - y && (N = x - z - C), I = Math.max(y, Math.min(I, window.innerWidth - y - M)), N = Math.max(y, N), se.value = { left: `${I}px`, top: `${N}px` };
|
|
1025
1029
|
}
|
|
1026
|
-
function
|
|
1030
|
+
function Rt(t, l) {
|
|
1027
1031
|
const c = d.value;
|
|
1028
1032
|
if (!c || e.readonly || !e.hover || w.value) {
|
|
1029
|
-
|
|
1033
|
+
F();
|
|
1030
1034
|
return;
|
|
1031
1035
|
}
|
|
1032
1036
|
if (c.selectionStart !== c.selectionEnd) {
|
|
1033
|
-
|
|
1037
|
+
F();
|
|
1034
1038
|
return;
|
|
1035
1039
|
}
|
|
1036
1040
|
const p = W.value;
|
|
@@ -1039,29 +1043,29 @@ const un = {
|
|
|
1039
1043
|
if (t >= k.left && t <= k.right && l >= k.top && l <= k.bottom)
|
|
1040
1044
|
return;
|
|
1041
1045
|
}
|
|
1042
|
-
const h = c.getBoundingClientRect(), m =
|
|
1046
|
+
const h = c.getBoundingClientRect(), m = St(t - h.left + c.scrollLeft, l - h.top + c.scrollTop);
|
|
1043
1047
|
if (!m) {
|
|
1044
|
-
|
|
1048
|
+
F();
|
|
1045
1049
|
return;
|
|
1046
1050
|
}
|
|
1047
|
-
if (g.value &&
|
|
1051
|
+
if (g.value && we === m.start && xe === m.end)
|
|
1048
1052
|
return;
|
|
1049
|
-
const x =
|
|
1050
|
-
completions:
|
|
1051
|
-
declared:
|
|
1053
|
+
const x = en(c.value, m.start, m.end, {
|
|
1054
|
+
completions: ve.value,
|
|
1055
|
+
declared: et(c.value, m.start)
|
|
1052
1056
|
});
|
|
1053
1057
|
if (!x) {
|
|
1054
|
-
|
|
1058
|
+
F();
|
|
1055
1059
|
return;
|
|
1056
1060
|
}
|
|
1057
|
-
g.value = x,
|
|
1061
|
+
g.value = x, we = m.start, xe = m.end, V(() => Et(m));
|
|
1058
1062
|
}
|
|
1059
|
-
function
|
|
1060
|
-
|
|
1061
|
-
|
|
1063
|
+
function Mt(t) {
|
|
1064
|
+
Te = { x: t.clientX, y: t.clientY }, !ce && (ce = requestAnimationFrame(() => {
|
|
1065
|
+
ce = 0, Rt(Te.x, Te.y);
|
|
1062
1066
|
}));
|
|
1063
1067
|
}
|
|
1064
|
-
function
|
|
1068
|
+
function Oe() {
|
|
1065
1069
|
const t = d.value;
|
|
1066
1070
|
if (!t) return null;
|
|
1067
1071
|
const l = window.getComputedStyle(t), c = document.createElement("div"), p = parseFloat(l.paddingLeft) || 0, h = parseFloat(l.paddingRight) || 0, m = t.getBoundingClientRect();
|
|
@@ -1096,80 +1100,80 @@ const un = {
|
|
|
1096
1100
|
x.textContent = "", c.appendChild(x), document.body.appendChild(c);
|
|
1097
1101
|
const k = x.getBoundingClientRect();
|
|
1098
1102
|
document.body.removeChild(c);
|
|
1099
|
-
const y = parseFloat(l.lineHeight) || 22, C = k.height,
|
|
1103
|
+
const y = parseFloat(l.lineHeight) || 22, C = k.height, M = C > 0 && C < y ? (y - C) / 2 : 0;
|
|
1100
1104
|
return {
|
|
1101
1105
|
left: k.left - m.left - t.scrollLeft,
|
|
1102
|
-
top: k.top - m.top - t.scrollTop -
|
|
1106
|
+
top: k.top - m.top - t.scrollTop - M,
|
|
1103
1107
|
lineHeight: y
|
|
1104
1108
|
};
|
|
1105
1109
|
}
|
|
1106
|
-
async function
|
|
1107
|
-
await
|
|
1108
|
-
const t =
|
|
1110
|
+
async function Ne() {
|
|
1111
|
+
await V();
|
|
1112
|
+
const t = T.value, l = v.value, c = Oe();
|
|
1109
1113
|
if (!t || !l || !c) return;
|
|
1110
|
-
const p = 4, h = 8, m = window.innerWidth, x = window.innerHeight, k = t.getBoundingClientRect(), y = l.scrollHeight, C = x - (k.top + c.top + c.lineHeight) - p - h,
|
|
1114
|
+
const p = 4, h = 8, m = window.innerWidth, x = window.innerHeight, k = t.getBoundingClientRect(), y = l.scrollHeight, C = x - (k.top + c.top + c.lineHeight) - p - h, M = k.top + c.top - p - h, z = C >= Math.min(y, 180) || C >= M, I = Math.min(248, Math.max(z ? C : M, 96)), N = Math.min(y, I), te = l.offsetWidth || 280;
|
|
1111
1115
|
let U = c.left;
|
|
1112
|
-
k.left + U +
|
|
1116
|
+
k.left + U + te > m - h && (U = m - h - te - k.left), U = Math.max(U, h - k.left), _.value = {
|
|
1113
1117
|
left: `${U}px`,
|
|
1114
|
-
top: `${
|
|
1115
|
-
maxHeight: `${
|
|
1118
|
+
top: `${z ? c.top + c.lineHeight + p : c.top - p - N}px`,
|
|
1119
|
+
maxHeight: `${I}px`
|
|
1116
1120
|
};
|
|
1117
1121
|
}
|
|
1118
|
-
function
|
|
1119
|
-
w.value = !1, O.value = [],
|
|
1122
|
+
function A() {
|
|
1123
|
+
w.value = !1, O.value = [], R.value = 0, F();
|
|
1120
1124
|
}
|
|
1121
1125
|
function ne(t = !1) {
|
|
1122
1126
|
var k;
|
|
1123
1127
|
const l = d.value;
|
|
1124
1128
|
if (!l || e.readonly) return;
|
|
1125
1129
|
if (l.selectionStart !== l.selectionEnd) {
|
|
1126
|
-
|
|
1130
|
+
A();
|
|
1127
1131
|
return;
|
|
1128
1132
|
}
|
|
1129
1133
|
const c = l.selectionStart;
|
|
1130
1134
|
let p = !t;
|
|
1131
|
-
const h =
|
|
1135
|
+
const h = Kt(l.value, c);
|
|
1132
1136
|
if (h) {
|
|
1133
|
-
const y = (k =
|
|
1137
|
+
const y = (k = bt.value.get(h.functionName)) == null ? void 0 : k.params[h.paramIndex], C = (y == null ? void 0 : y.literals) ?? [];
|
|
1134
1138
|
if (C.length) {
|
|
1135
|
-
const
|
|
1136
|
-
label: `${
|
|
1139
|
+
const M = h.quote ?? "'", z = C.map((N) => ({
|
|
1140
|
+
label: `${M}${N}${M}`,
|
|
1137
1141
|
kind: "value",
|
|
1138
1142
|
detail: y == null ? void 0 : y.type,
|
|
1139
|
-
insertText: `${
|
|
1140
|
-
})),
|
|
1141
|
-
if (
|
|
1142
|
-
O.value =
|
|
1143
|
+
insertText: `${M}${N}${M}`
|
|
1144
|
+
})), I = dt(z, h.prefix);
|
|
1145
|
+
if (I.length) {
|
|
1146
|
+
O.value = I, $.value = { start: h.replaceStart, end: c }, R.value = 0, w.value = !0, Ne();
|
|
1143
1147
|
return;
|
|
1144
1148
|
}
|
|
1145
1149
|
}
|
|
1146
1150
|
}
|
|
1147
1151
|
if (e.mode === "template") {
|
|
1148
|
-
const y =
|
|
1152
|
+
const y = Me(
|
|
1149
1153
|
l.value,
|
|
1150
1154
|
c,
|
|
1151
1155
|
e.templateOpen,
|
|
1152
1156
|
e.templateClose
|
|
1153
1157
|
);
|
|
1154
1158
|
if (!y) {
|
|
1155
|
-
|
|
1159
|
+
A();
|
|
1156
1160
|
return;
|
|
1157
1161
|
}
|
|
1158
1162
|
t && l.value.slice(y.start, c).trim() === "" && (p = !0);
|
|
1159
1163
|
}
|
|
1160
|
-
const m =
|
|
1164
|
+
const m = Gt(l.value, c, {
|
|
1161
1165
|
language: e.language,
|
|
1162
|
-
completions:
|
|
1163
|
-
declared:
|
|
1166
|
+
completions: ve.value,
|
|
1167
|
+
declared: et(l.value, c),
|
|
1164
1168
|
auto: !p
|
|
1165
1169
|
});
|
|
1166
1170
|
if (!m) {
|
|
1167
|
-
|
|
1171
|
+
A();
|
|
1168
1172
|
return;
|
|
1169
1173
|
}
|
|
1170
1174
|
let x = m.items;
|
|
1171
1175
|
if (e.completionFilter) {
|
|
1172
|
-
const y =
|
|
1176
|
+
const y = ct(l.value, c);
|
|
1173
1177
|
if (x = e.completionFilter(x, {
|
|
1174
1178
|
prefix: y.prefix,
|
|
1175
1179
|
chain: y.chain,
|
|
@@ -1178,52 +1182,52 @@ const un = {
|
|
|
1178
1182
|
mode: e.mode,
|
|
1179
1183
|
language: e.language
|
|
1180
1184
|
}), x.length === 0) {
|
|
1181
|
-
|
|
1185
|
+
A();
|
|
1182
1186
|
return;
|
|
1183
1187
|
}
|
|
1184
1188
|
}
|
|
1185
|
-
O.value = x,
|
|
1189
|
+
O.value = x, $.value = { start: m.start, end: m.end }, R.value = 0, w.value = !0, Ne();
|
|
1186
1190
|
}
|
|
1187
|
-
function
|
|
1191
|
+
function It(t) {
|
|
1188
1192
|
a.value = t, i("update:modelValue", t), i("change", t);
|
|
1189
1193
|
}
|
|
1190
|
-
function
|
|
1194
|
+
function ue(t, l, c, p = t + c.length) {
|
|
1191
1195
|
const h = d.value;
|
|
1192
1196
|
if (!h) return;
|
|
1193
1197
|
const m = h.value.slice(0, t) + c + h.value.slice(l);
|
|
1194
|
-
|
|
1195
|
-
h.value = m, h.setSelectionRange(p, p), h.focus(),
|
|
1198
|
+
It(m), A(), V(() => {
|
|
1199
|
+
h.value = m, h.setSelectionRange(p, p), h.focus(), j(!0), X();
|
|
1196
1200
|
});
|
|
1197
1201
|
}
|
|
1198
|
-
function
|
|
1202
|
+
function We(t = O.value[R.value]) {
|
|
1199
1203
|
if (!t) return;
|
|
1200
1204
|
const l = t.insertText ?? t.label;
|
|
1201
|
-
|
|
1205
|
+
ue($.value.start, $.value.end, l), A();
|
|
1202
1206
|
}
|
|
1203
|
-
function
|
|
1207
|
+
function ze(t) {
|
|
1204
1208
|
const l = O.value.length;
|
|
1205
|
-
l && (
|
|
1209
|
+
l && (R.value = (R.value + t + l) % l, V(() => {
|
|
1206
1210
|
var c, p;
|
|
1207
1211
|
(p = (c = v.value) == null ? void 0 : c.querySelector(".is-active")) == null || p.scrollIntoView({ block: "nearest" });
|
|
1208
1212
|
}));
|
|
1209
1213
|
}
|
|
1210
|
-
function
|
|
1214
|
+
function Ht(t) {
|
|
1211
1215
|
const l = t.target;
|
|
1212
|
-
a.value = l.value, i("update:modelValue", l.value), i("change", l.value),
|
|
1216
|
+
a.value = l.value, i("update:modelValue", l.value), i("change", l.value), F(), j(), X(), V(X), ne(!0);
|
|
1213
1217
|
}
|
|
1214
|
-
function
|
|
1215
|
-
if (
|
|
1218
|
+
function Lt(t) {
|
|
1219
|
+
if (A(), F(), !e.collapsible || !e.collapseOnBlur || !P.value) return;
|
|
1216
1220
|
const l = t.relatedTarget;
|
|
1217
|
-
l && l.closest(".expand-toggle") ||
|
|
1221
|
+
l && l.closest(".expand-toggle") || Le(!1);
|
|
1218
1222
|
}
|
|
1219
|
-
function
|
|
1220
|
-
|
|
1223
|
+
function _t() {
|
|
1224
|
+
De(), X();
|
|
1221
1225
|
}
|
|
1222
|
-
function
|
|
1226
|
+
function De() {
|
|
1223
1227
|
const t = d.value;
|
|
1224
1228
|
if (!t || e.readonly) return;
|
|
1225
1229
|
if (t.selectionStart !== t.selectionEnd) {
|
|
1226
|
-
|
|
1230
|
+
A();
|
|
1227
1231
|
return;
|
|
1228
1232
|
}
|
|
1229
1233
|
const l = t.selectionStart;
|
|
@@ -1232,7 +1236,7 @@ const un = {
|
|
|
1232
1236
|
return;
|
|
1233
1237
|
}
|
|
1234
1238
|
if (e.mode === "template") {
|
|
1235
|
-
const c =
|
|
1239
|
+
const c = Me(
|
|
1236
1240
|
t.value,
|
|
1237
1241
|
l,
|
|
1238
1242
|
e.templateOpen,
|
|
@@ -1243,33 +1247,33 @@ const un = {
|
|
|
1243
1247
|
return;
|
|
1244
1248
|
}
|
|
1245
1249
|
}
|
|
1246
|
-
|
|
1250
|
+
A();
|
|
1247
1251
|
}
|
|
1248
|
-
let
|
|
1249
|
-
function
|
|
1250
|
-
window.clearTimeout(
|
|
1251
|
-
|
|
1252
|
+
let $e = 0;
|
|
1253
|
+
function je() {
|
|
1254
|
+
window.clearTimeout($e), $e = window.setTimeout(() => {
|
|
1255
|
+
$e = 0, De(), X();
|
|
1252
1256
|
}, 0);
|
|
1253
1257
|
}
|
|
1254
|
-
function
|
|
1255
|
-
t.target !== d.value && w.value &&
|
|
1258
|
+
function Fe(t) {
|
|
1259
|
+
t.target !== d.value && w.value && A();
|
|
1256
1260
|
}
|
|
1257
|
-
function
|
|
1258
|
-
|
|
1261
|
+
function At() {
|
|
1262
|
+
F(), j(), re.value && Bt();
|
|
1259
1263
|
}
|
|
1260
|
-
let
|
|
1261
|
-
function
|
|
1262
|
-
window.clearTimeout(
|
|
1263
|
-
|
|
1264
|
+
let Ce = 0;
|
|
1265
|
+
function Bt() {
|
|
1266
|
+
window.clearTimeout(Ce), Ce = window.setTimeout(() => {
|
|
1267
|
+
Ce = 0, Ot();
|
|
1264
1268
|
}, 120);
|
|
1265
1269
|
}
|
|
1266
|
-
function
|
|
1270
|
+
function Ot() {
|
|
1267
1271
|
const t = d.value;
|
|
1268
1272
|
if (!t) return;
|
|
1269
|
-
const l =
|
|
1270
|
-
Math.abs(p - c) < 0.5 || (t.scrollTop = p,
|
|
1273
|
+
const l = Q.lineHeight, c = t.scrollTop, p = Math.round(c / l) * l;
|
|
1274
|
+
Math.abs(p - c) < 0.5 || (t.scrollTop = p, j());
|
|
1271
1275
|
}
|
|
1272
|
-
function
|
|
1276
|
+
function Nt(t) {
|
|
1273
1277
|
var h;
|
|
1274
1278
|
const l = d.value;
|
|
1275
1279
|
if (!l) return;
|
|
@@ -1280,28 +1284,28 @@ const un = {
|
|
|
1280
1284
|
}
|
|
1281
1285
|
if (w.value) {
|
|
1282
1286
|
if (t.key === "ArrowDown") {
|
|
1283
|
-
t.preventDefault(),
|
|
1287
|
+
t.preventDefault(), ze(1);
|
|
1284
1288
|
return;
|
|
1285
1289
|
}
|
|
1286
1290
|
if (t.key === "ArrowUp") {
|
|
1287
|
-
t.preventDefault(),
|
|
1291
|
+
t.preventDefault(), ze(-1);
|
|
1288
1292
|
return;
|
|
1289
1293
|
}
|
|
1290
1294
|
if (t.key === "Enter" || t.key === "Tab") {
|
|
1291
|
-
t.preventDefault(),
|
|
1295
|
+
t.preventDefault(), We();
|
|
1292
1296
|
return;
|
|
1293
1297
|
}
|
|
1294
1298
|
if (t.key === "Escape") {
|
|
1295
|
-
t.preventDefault(),
|
|
1299
|
+
t.preventDefault(), A();
|
|
1296
1300
|
return;
|
|
1297
1301
|
}
|
|
1298
1302
|
if (p || c) {
|
|
1299
|
-
|
|
1303
|
+
A(), p && !c && je();
|
|
1300
1304
|
return;
|
|
1301
1305
|
}
|
|
1302
1306
|
}
|
|
1303
1307
|
if (p && !c) {
|
|
1304
|
-
|
|
1308
|
+
je();
|
|
1305
1309
|
return;
|
|
1306
1310
|
}
|
|
1307
1311
|
if (t.key === "Enter" && !c && !t.shiftKey) {
|
|
@@ -1309,59 +1313,59 @@ const un = {
|
|
|
1309
1313
|
if (m !== l.selectionEnd) return;
|
|
1310
1314
|
const x = l.value.lastIndexOf(`
|
|
1311
1315
|
`, m - 1) + 1, k = l.value.slice(x, m), y = ((h = k.match(/^[ \t]*/)) == null ? void 0 : h[0]) ?? "", C = /[{[(]$/.test(k.trimEnd()) ? " " : "";
|
|
1312
|
-
t.preventDefault(),
|
|
1316
|
+
t.preventDefault(), ue(m, m, `
|
|
1313
1317
|
${y}${C}`);
|
|
1314
1318
|
return;
|
|
1315
1319
|
}
|
|
1316
1320
|
if (t.key === "Tab") {
|
|
1317
|
-
t.preventDefault(),
|
|
1321
|
+
t.preventDefault(), ue(l.selectionStart, l.selectionEnd, " ");
|
|
1318
1322
|
return;
|
|
1319
1323
|
}
|
|
1320
1324
|
if (t.key.length === 1 && !c && !t.altKey && f[t.key]) {
|
|
1321
1325
|
if (l.selectionStart !== l.selectionEnd) return;
|
|
1322
1326
|
const m = l.selectionStart, x = l.value[m - 1], k = l.value[m];
|
|
1323
1327
|
if ((t.key === '"' || t.key === "'") && x && /[\w$]/.test(x) || k !== void 0 && !/[\s)\]},;:]/.test(k)) return;
|
|
1324
|
-
t.preventDefault(),
|
|
1328
|
+
t.preventDefault(), ue(m, m, t.key + f[t.key], m + 1), e.mode === "template" && V(() => ne(!0));
|
|
1325
1329
|
}
|
|
1326
1330
|
}
|
|
1327
|
-
function
|
|
1328
|
-
w.value &&
|
|
1329
|
-
|
|
1331
|
+
function Pe() {
|
|
1332
|
+
w.value && A(), F(), V(() => {
|
|
1333
|
+
ke(), j(!0);
|
|
1330
1334
|
});
|
|
1331
1335
|
}
|
|
1332
|
-
let
|
|
1333
|
-
return
|
|
1334
|
-
window.addEventListener("resize",
|
|
1335
|
-
|
|
1336
|
-
}), typeof ResizeObserver < "u" && d.value && (
|
|
1337
|
-
|
|
1338
|
-
}),
|
|
1339
|
-
}),
|
|
1340
|
-
window.removeEventListener("resize",
|
|
1336
|
+
let ee = null;
|
|
1337
|
+
return jt(() => {
|
|
1338
|
+
window.addEventListener("resize", Pe), window.addEventListener("scroll", Fe, !0), V(() => {
|
|
1339
|
+
ke(), j(!0);
|
|
1340
|
+
}), typeof ResizeObserver < "u" && d.value && (ee = new ResizeObserver(() => {
|
|
1341
|
+
j(!0), X();
|
|
1342
|
+
}), ee.observe(d.value));
|
|
1343
|
+
}), Ft(() => {
|
|
1344
|
+
window.removeEventListener("resize", Pe), window.removeEventListener("scroll", Fe, !0), ee == null || ee.disconnect(), ee = null;
|
|
1341
1345
|
}), s({ focus: () => {
|
|
1342
1346
|
var t;
|
|
1343
1347
|
return (t = d.value) == null ? void 0 : t.focus();
|
|
1344
|
-
} }), (t, l) => (
|
|
1345
|
-
class:
|
|
1346
|
-
style:
|
|
1348
|
+
} }), (t, l) => (H(), L("div", {
|
|
1349
|
+
class: ie(["code-input", { "is-collapsible": n.collapsible }]),
|
|
1350
|
+
style: he(kt.value)
|
|
1347
1351
|
}, [
|
|
1348
1352
|
B("div", {
|
|
1349
|
-
class:
|
|
1353
|
+
class: ie(["code-editor", {
|
|
1350
1354
|
"is-readonly": n.readonly,
|
|
1351
1355
|
"is-dark": n.theme === "dark",
|
|
1352
|
-
"is-collapsed":
|
|
1353
|
-
"is-expanding":
|
|
1356
|
+
"is-collapsed": re.value,
|
|
1357
|
+
"is-expanding": ye.value
|
|
1354
1358
|
}]),
|
|
1355
|
-
style:
|
|
1356
|
-
onAnimationend:
|
|
1359
|
+
style: he(wt.value),
|
|
1360
|
+
onAnimationend: Ue(xt, ["self"])
|
|
1357
1361
|
}, [
|
|
1358
|
-
n.lineNumbers ? (
|
|
1362
|
+
n.lineNumbers ? (H(), L("div", hn, [
|
|
1359
1363
|
B("div", {
|
|
1360
1364
|
ref_key: "gutterInner",
|
|
1361
1365
|
ref: b,
|
|
1362
1366
|
class: "gutter-inner code-font"
|
|
1363
1367
|
}, [
|
|
1364
|
-
(
|
|
1368
|
+
(H(!0), L(Ye, null, Xe(yt.value, (c) => (H(), L("div", {
|
|
1365
1369
|
key: c,
|
|
1366
1370
|
class: "gutter-line"
|
|
1367
1371
|
}, Y(c), 1))), 128))
|
|
@@ -1369,12 +1373,12 @@ ${y}${C}`);
|
|
|
1369
1373
|
])) : K("", !0),
|
|
1370
1374
|
B("div", {
|
|
1371
1375
|
ref_key: "stage",
|
|
1372
|
-
ref:
|
|
1376
|
+
ref: T,
|
|
1373
1377
|
class: "stage"
|
|
1374
1378
|
}, [
|
|
1375
1379
|
B("div", {
|
|
1376
1380
|
ref_key: "highlightLayer",
|
|
1377
|
-
ref:
|
|
1381
|
+
ref: D,
|
|
1378
1382
|
class: "highlight code-font"
|
|
1379
1383
|
}, [
|
|
1380
1384
|
B("pre", {
|
|
@@ -1382,7 +1386,7 @@ ${y}${C}`);
|
|
|
1382
1386
|
ref: S,
|
|
1383
1387
|
class: "code-font"
|
|
1384
1388
|
}, [
|
|
1385
|
-
B("code", { innerHTML:
|
|
1389
|
+
B("code", { innerHTML: vt.value }, null, 8, gn)
|
|
1386
1390
|
], 512)
|
|
1387
1391
|
], 512),
|
|
1388
1392
|
B("textarea", {
|
|
@@ -1397,70 +1401,70 @@ ${y}${C}`);
|
|
|
1397
1401
|
autocapitalize: "off",
|
|
1398
1402
|
autocorrect: "off",
|
|
1399
1403
|
wrap: "off",
|
|
1400
|
-
onInput:
|
|
1401
|
-
onKeydown:
|
|
1402
|
-
onScroll:
|
|
1403
|
-
onClick:
|
|
1404
|
-
onMousemove:
|
|
1405
|
-
onMouseleave:
|
|
1406
|
-
onBlur:
|
|
1407
|
-
}, null, 40,
|
|
1408
|
-
w.value ? (
|
|
1404
|
+
onInput: Ht,
|
|
1405
|
+
onKeydown: Nt,
|
|
1406
|
+
onScroll: At,
|
|
1407
|
+
onClick: _t,
|
|
1408
|
+
onMousemove: Mt,
|
|
1409
|
+
onMouseleave: F,
|
|
1410
|
+
onBlur: Lt
|
|
1411
|
+
}, null, 40, bn),
|
|
1412
|
+
w.value ? (H(), L("ul", {
|
|
1409
1413
|
key: 0,
|
|
1410
1414
|
ref_key: "popup",
|
|
1411
1415
|
ref: v,
|
|
1412
1416
|
class: "popup",
|
|
1413
|
-
style:
|
|
1414
|
-
onMousedown: l[0] || (l[0] =
|
|
1417
|
+
style: he(_.value),
|
|
1418
|
+
onMousedown: l[0] || (l[0] = Ue(() => {
|
|
1415
1419
|
}, ["prevent"]))
|
|
1416
1420
|
}, [
|
|
1417
|
-
(
|
|
1421
|
+
(H(!0), L(Ye, null, Xe(O.value, (c, p) => (H(), L("li", {
|
|
1418
1422
|
key: `${c.label}-${p}`,
|
|
1419
|
-
class:
|
|
1420
|
-
onMouseenter: (h) =>
|
|
1421
|
-
onClick: (h) =>
|
|
1423
|
+
class: ie(["popup-item", { "is-active": p === R.value }]),
|
|
1424
|
+
onMouseenter: (h) => R.value = p,
|
|
1425
|
+
onClick: (h) => We(c)
|
|
1422
1426
|
}, [
|
|
1423
1427
|
B("span", {
|
|
1424
|
-
class:
|
|
1425
|
-
}, Y(
|
|
1426
|
-
B("span",
|
|
1427
|
-
c.detail ? (
|
|
1428
|
-
], 42,
|
|
1428
|
+
class: ie(["badge", `badge-${c.kind}`])
|
|
1429
|
+
}, Y(_e(c.kind)), 3),
|
|
1430
|
+
B("span", yn, Y(c.label), 1),
|
|
1431
|
+
c.detail ? (H(), L("span", kn, Y(c.detail), 1)) : K("", !0)
|
|
1432
|
+
], 42, vn))), 128))
|
|
1429
1433
|
], 36)) : K("", !0),
|
|
1430
|
-
g.value ? (
|
|
1434
|
+
g.value ? (H(), L("div", {
|
|
1431
1435
|
key: 1,
|
|
1432
1436
|
ref_key: "hoverCard",
|
|
1433
1437
|
ref: W,
|
|
1434
1438
|
class: "hover-card",
|
|
1435
|
-
style:
|
|
1439
|
+
style: he(se.value)
|
|
1436
1440
|
}, [
|
|
1437
|
-
B("div",
|
|
1441
|
+
B("div", wn, [
|
|
1438
1442
|
B("span", {
|
|
1439
|
-
class:
|
|
1440
|
-
}, Y(
|
|
1441
|
-
B("span",
|
|
1442
|
-
|
|
1443
|
-
g.value.detail ? (
|
|
1443
|
+
class: ie(["badge", `badge-${g.value.kind}`])
|
|
1444
|
+
}, Y(_e(g.value.kind)), 3),
|
|
1445
|
+
B("span", xn, [
|
|
1446
|
+
Pt(Y(g.value.label), 1),
|
|
1447
|
+
g.value.detail ? (H(), L("span", Tn, ":")) : K("", !0)
|
|
1444
1448
|
]),
|
|
1445
|
-
g.value.detail ? (
|
|
1449
|
+
g.value.detail ? (H(), L("span", $n, Y(g.value.detail), 1)) : K("", !0)
|
|
1446
1450
|
]),
|
|
1447
|
-
g.value.documentation ? (
|
|
1448
|
-
g.value.type ? (
|
|
1451
|
+
g.value.documentation ? (H(), L("p", Cn, Y(g.value.documentation), 1)) : K("", !0),
|
|
1452
|
+
g.value.type ? (H(), L("pre", Sn, [
|
|
1449
1453
|
B("code", {
|
|
1450
|
-
innerHTML:
|
|
1451
|
-
}, null, 8,
|
|
1454
|
+
innerHTML: $t(g.value.type)
|
|
1455
|
+
}, null, 8, En)
|
|
1452
1456
|
])) : K("", !0)
|
|
1453
1457
|
], 4)) : K("", !0)
|
|
1454
1458
|
], 512),
|
|
1455
|
-
n.collapsible ? (
|
|
1459
|
+
n.collapsible ? (H(), L("button", {
|
|
1456
1460
|
key: 1,
|
|
1457
1461
|
type: "button",
|
|
1458
1462
|
class: "expand-toggle",
|
|
1459
|
-
title:
|
|
1460
|
-
"aria-label":
|
|
1461
|
-
onClick:
|
|
1463
|
+
title: P.value ? "收起" : "展开",
|
|
1464
|
+
"aria-label": P.value ? "收起编辑器" : "展开编辑器",
|
|
1465
|
+
onClick: Tt
|
|
1462
1466
|
}, [
|
|
1463
|
-
|
|
1467
|
+
P.value ? (H(), L("svg", In, [...l[2] || (l[2] = [
|
|
1464
1468
|
B("path", {
|
|
1465
1469
|
d: "M11 2 5 8 11 14",
|
|
1466
1470
|
fill: "none",
|
|
@@ -1469,7 +1473,7 @@ ${y}${C}`);
|
|
|
1469
1473
|
"stroke-linecap": "round",
|
|
1470
1474
|
"stroke-linejoin": "round"
|
|
1471
1475
|
}, null, -1)
|
|
1472
|
-
])])) : (
|
|
1476
|
+
])])) : (H(), L("svg", Mn, [...l[1] || (l[1] = [
|
|
1473
1477
|
B("path", {
|
|
1474
1478
|
d: "M6 2 12 8 6 14",
|
|
1475
1479
|
fill: "none",
|
|
@@ -1479,35 +1483,35 @@ ${y}${C}`);
|
|
|
1479
1483
|
"stroke-linejoin": "round"
|
|
1480
1484
|
}, null, -1)
|
|
1481
1485
|
])]))
|
|
1482
|
-
], 8,
|
|
1486
|
+
], 8, Rn)) : K("", !0)
|
|
1483
1487
|
], 38)
|
|
1484
1488
|
], 6));
|
|
1485
1489
|
}
|
|
1486
|
-
}),
|
|
1490
|
+
}), Ln = (n, s) => {
|
|
1487
1491
|
const o = n.__vccOpts || n;
|
|
1488
1492
|
for (const [e, i] of s)
|
|
1489
1493
|
o[e] = i;
|
|
1490
1494
|
return o;
|
|
1491
|
-
},
|
|
1495
|
+
}, _n = /* @__PURE__ */ Ln(Hn, [["__scopeId", "data-v-e1c19d60"]]), On = {
|
|
1492
1496
|
install(n) {
|
|
1493
|
-
n.component("CodeInput",
|
|
1497
|
+
n.component("CodeInput", _n);
|
|
1494
1498
|
}
|
|
1495
1499
|
};
|
|
1496
1500
|
export {
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1501
|
+
_n as CodeEditor,
|
|
1502
|
+
Gt as collectCompletions,
|
|
1503
|
+
On as default,
|
|
1504
|
+
Vt as defaultCompletions,
|
|
1505
|
+
Kt as findArgumentContext,
|
|
1506
|
+
Me as findTemplateRange,
|
|
1507
|
+
Ge as getKeywordSet,
|
|
1508
|
+
rt as getKeywords,
|
|
1509
|
+
be as highlight,
|
|
1510
|
+
mn as highlightTemplate,
|
|
1511
|
+
Bn as isInsideTemplate,
|
|
1512
|
+
cn as parseTsCompletions,
|
|
1513
|
+
un as parseTsSignatures,
|
|
1514
|
+
en as resolveHoverItem,
|
|
1515
|
+
et as scanDeclarations,
|
|
1516
|
+
ge as tokenize
|
|
1513
1517
|
};
|