@onerjs/code-input 0.1.6 → 0.1.8
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 +393 -386
- 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 I, createElementBlock as H, normalizeStyle as he, normalizeClass as ie, createElementVNode as A, 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 Qe(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$]*)?$/, Ge = /\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 (Ge.lastIndex = 0; (i = Ge.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 Qt(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 Gt = /([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 = Gt.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: L } = 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(L),
|
|
579
579
|
kind: "interface",
|
|
580
580
|
documentation: w || void 0
|
|
581
|
-
}),
|
|
581
|
+
}), oe(s, $), b = $;
|
|
582
582
|
continue;
|
|
583
583
|
}
|
|
584
|
-
const
|
|
585
|
-
if (
|
|
586
|
-
const w =
|
|
584
|
+
const N = r.exec(v);
|
|
585
|
+
if (N && v.includes("{")) {
|
|
586
|
+
const w = J(u);
|
|
587
587
|
u = [];
|
|
588
|
-
const { end:
|
|
588
|
+
const { end: $, body: L } = nt(s, b), g = N[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(L),
|
|
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
|
|
605
|
+
const $ = [s[b]];
|
|
606
606
|
let L = b;
|
|
607
|
-
for (;
|
|
607
|
+
for (; an($.join(`
|
|
608
608
|
`)) && L + 1 < s.length; )
|
|
609
|
-
L++,
|
|
610
|
-
const g =
|
|
609
|
+
L++, $.push(s[L]);
|
|
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, L), b = L;
|
|
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
|
-
const
|
|
663
|
-
if (
|
|
664
|
-
|
|
665
|
-
const
|
|
662
|
+
const N = S.exec(v);
|
|
663
|
+
if (N) {
|
|
664
|
+
oe(s, b);
|
|
665
|
+
const R = J(u);
|
|
666
666
|
u = [];
|
|
667
|
-
const w =
|
|
668
|
-
if (
|
|
669
|
-
|
|
670
|
-
const
|
|
667
|
+
const w = N[1];
|
|
668
|
+
if (T.has(w)) continue;
|
|
669
|
+
T.add(w);
|
|
670
|
+
const $ = N[2].trim(), L = pt($), g = L ? o.get(L) : 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,32 +756,32 @@ 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
781
|
function Q(n) {
|
|
782
|
-
return n.replace(/[&<>]/g, (s) =>
|
|
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
787
|
r.start > i && (e += Q(n.slice(i, r.start)));
|
|
@@ -790,8 +790,8 @@ function de(n, s, o = 0) {
|
|
|
790
790
|
}
|
|
791
791
|
return i < n.length && (e += Q(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);
|
|
@@ -801,42 +801,42 @@ function cn(n, s, o, e) {
|
|
|
801
801
|
}
|
|
802
802
|
i += Q(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">${Q(o)}</span>`, i +=
|
|
804
|
+
i += `<span class="tok-brace">${Q(o)}</span>`, i += be(d, ge(d, s), f + o.length), u === -1 ? r = a : (i += `<span class="tok-brace">${Q(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(), N = E([]), R = E(0), w = E(!1), $ = E({ start: 0, end: 0 }), L = 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: Qe(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"), _(), 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
940
|
t !== a.value && (a.value = t, _());
|
|
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: Qe("typescript"), builtins: /* @__PURE__ */ new Set() })
|
|
952
952
|
) : "";
|
|
953
953
|
}
|
|
954
|
-
let
|
|
955
|
-
function
|
|
954
|
+
let G = { 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
|
+
G = {
|
|
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 = G.top * h, k = G.bottom * h, y = l.lineHeight * h, C = t.scrollTop * h, B = Math.max(0, t.scrollHeight * h - m), z = (re.value ? 8 : 14) * h;
|
|
982
|
+
let M = t.scrollTop;
|
|
983
|
+
if (re.value) {
|
|
984
|
+
const me = m - x - k, le = l.top + C - x - Math.max(0, (me - y) / 2);
|
|
985
|
+
M = Math.max(0, Math.min(le, B)) / 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)), M = Math.max(0, Math.min(Re, B)) / h;
|
|
986
990
|
}
|
|
987
|
-
const
|
|
988
|
-
let
|
|
989
|
-
|
|
990
|
-
const
|
|
991
|
-
!
|
|
992
|
-
}
|
|
993
|
-
let
|
|
994
|
-
function
|
|
995
|
-
const t = d.value, l =
|
|
991
|
+
const O = t.clientWidth * p, te = G.left * p, U = G.right * p, Se = t.scrollLeft * p, de = l.left + Se, Wt = Se + te, zt = Se + O - 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 - O + U + fe) / p));
|
|
994
|
+
const Ve = Math.abs(M - t.scrollTop) > 0.5, qe = Math.abs(pe - t.scrollLeft) > 0.5;
|
|
995
|
+
!Ve && !qe || (Ve && (t.scrollTop = M), 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, B = l.offsetWidth, z = l.offsetHeight;
|
|
1027
|
+
let M = h, O = k + C;
|
|
1028
|
+
M + B > window.innerWidth - y && (M = m - B), O + z > window.innerHeight - y && (O = x - z - C), M = Math.max(y, Math.min(M, window.innerWidth - y - B)), O = Math.max(y, O), se.value = { left: `${M}px`, top: `${O}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,27 +1100,27 @@ 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, B = 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 - B,
|
|
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, B = k.top + c.top - p - h, z = C >= Math.min(y, 180) || C >= B, M = Math.min(248, Math.max(z ? C : B, 96)), O = Math.min(y, M), 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), L.value = {
|
|
1113
1117
|
left: `${U}px`,
|
|
1114
|
-
top: `${
|
|
1115
|
-
maxHeight: `${
|
|
1118
|
+
top: `${z ? c.top + c.lineHeight + p : c.top - p - O}px`,
|
|
1119
|
+
maxHeight: `${M}px`
|
|
1116
1120
|
};
|
|
1117
1121
|
}
|
|
1118
1122
|
function _() {
|
|
1119
|
-
w.value = !1,
|
|
1123
|
+
w.value = !1, N.value = [], R.value = 0, F();
|
|
1120
1124
|
}
|
|
1121
1125
|
function ne(t = !1) {
|
|
1122
1126
|
var k;
|
|
@@ -1128,24 +1132,27 @@ const un = {
|
|
|
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 B = h.quote, z = C.map((O) => ({
|
|
1140
|
+
label: `'${O}'`,
|
|
1137
1141
|
kind: "value",
|
|
1138
1142
|
detail: y == null ? void 0 : y.type,
|
|
1139
|
-
insertText:
|
|
1140
|
-
})),
|
|
1141
|
-
if (
|
|
1142
|
-
|
|
1143
|
+
insertText: B ? O : `'${O}'`
|
|
1144
|
+
})), M = dt(z, h.prefix);
|
|
1145
|
+
if (M.length) {
|
|
1146
|
+
N.value = M, $.value = {
|
|
1147
|
+
start: B ? h.replaceStart + 1 : h.replaceStart,
|
|
1148
|
+
end: c
|
|
1149
|
+
}, R.value = 0, w.value = !0, Ne();
|
|
1143
1150
|
return;
|
|
1144
1151
|
}
|
|
1145
1152
|
}
|
|
1146
1153
|
}
|
|
1147
1154
|
if (e.mode === "template") {
|
|
1148
|
-
const y =
|
|
1155
|
+
const y = Me(
|
|
1149
1156
|
l.value,
|
|
1150
1157
|
c,
|
|
1151
1158
|
e.templateOpen,
|
|
@@ -1157,10 +1164,10 @@ const un = {
|
|
|
1157
1164
|
}
|
|
1158
1165
|
t && l.value.slice(y.start, c).trim() === "" && (p = !0);
|
|
1159
1166
|
}
|
|
1160
|
-
const m =
|
|
1167
|
+
const m = Qt(l.value, c, {
|
|
1161
1168
|
language: e.language,
|
|
1162
|
-
completions:
|
|
1163
|
-
declared:
|
|
1169
|
+
completions: ve.value,
|
|
1170
|
+
declared: et(l.value, c),
|
|
1164
1171
|
auto: !p
|
|
1165
1172
|
});
|
|
1166
1173
|
if (!m) {
|
|
@@ -1169,7 +1176,7 @@ const un = {
|
|
|
1169
1176
|
}
|
|
1170
1177
|
let x = m.items;
|
|
1171
1178
|
if (e.completionFilter) {
|
|
1172
|
-
const y =
|
|
1179
|
+
const y = ct(l.value, c);
|
|
1173
1180
|
if (x = e.completionFilter(x, {
|
|
1174
1181
|
prefix: y.prefix,
|
|
1175
1182
|
chain: y.chain,
|
|
@@ -1182,44 +1189,44 @@ const un = {
|
|
|
1182
1189
|
return;
|
|
1183
1190
|
}
|
|
1184
1191
|
}
|
|
1185
|
-
|
|
1192
|
+
N.value = x, $.value = { start: m.start, end: m.end }, R.value = 0, w.value = !0, Ne();
|
|
1186
1193
|
}
|
|
1187
|
-
function
|
|
1194
|
+
function It(t) {
|
|
1188
1195
|
a.value = t, i("update:modelValue", t), i("change", t);
|
|
1189
1196
|
}
|
|
1190
|
-
function
|
|
1197
|
+
function ue(t, l, c, p = t + c.length) {
|
|
1191
1198
|
const h = d.value;
|
|
1192
1199
|
if (!h) return;
|
|
1193
1200
|
const m = h.value.slice(0, t) + c + h.value.slice(l);
|
|
1194
|
-
|
|
1195
|
-
h.value = m, h.setSelectionRange(p, p), h.focus(),
|
|
1201
|
+
It(m), _(), V(() => {
|
|
1202
|
+
h.value = m, h.setSelectionRange(p, p), h.focus(), j(!0), X();
|
|
1196
1203
|
});
|
|
1197
1204
|
}
|
|
1198
|
-
function
|
|
1205
|
+
function We(t = N.value[R.value]) {
|
|
1199
1206
|
if (!t) return;
|
|
1200
1207
|
const l = t.insertText ?? t.label;
|
|
1201
|
-
|
|
1208
|
+
ue($.value.start, $.value.end, l), _();
|
|
1202
1209
|
}
|
|
1203
|
-
function
|
|
1204
|
-
const l =
|
|
1205
|
-
l && (
|
|
1210
|
+
function ze(t) {
|
|
1211
|
+
const l = N.value.length;
|
|
1212
|
+
l && (R.value = (R.value + t + l) % l, V(() => {
|
|
1206
1213
|
var c, p;
|
|
1207
1214
|
(p = (c = v.value) == null ? void 0 : c.querySelector(".is-active")) == null || p.scrollIntoView({ block: "nearest" });
|
|
1208
1215
|
}));
|
|
1209
1216
|
}
|
|
1210
|
-
function
|
|
1217
|
+
function Ht(t) {
|
|
1211
1218
|
const l = t.target;
|
|
1212
|
-
a.value = l.value, i("update:modelValue", l.value), i("change", l.value),
|
|
1219
|
+
a.value = l.value, i("update:modelValue", l.value), i("change", l.value), F(), j(), X(), V(X), ne(!0);
|
|
1213
1220
|
}
|
|
1214
|
-
function
|
|
1215
|
-
if (_(),
|
|
1221
|
+
function Lt(t) {
|
|
1222
|
+
if (_(), F(), !e.collapsible || !e.collapseOnBlur || !P.value) return;
|
|
1216
1223
|
const l = t.relatedTarget;
|
|
1217
|
-
l && l.closest(".expand-toggle") ||
|
|
1224
|
+
l && l.closest(".expand-toggle") || Le(!1);
|
|
1218
1225
|
}
|
|
1219
|
-
function
|
|
1220
|
-
|
|
1226
|
+
function _t() {
|
|
1227
|
+
De(), X();
|
|
1221
1228
|
}
|
|
1222
|
-
function
|
|
1229
|
+
function De() {
|
|
1223
1230
|
const t = d.value;
|
|
1224
1231
|
if (!t || e.readonly) return;
|
|
1225
1232
|
if (t.selectionStart !== t.selectionEnd) {
|
|
@@ -1232,7 +1239,7 @@ const un = {
|
|
|
1232
1239
|
return;
|
|
1233
1240
|
}
|
|
1234
1241
|
if (e.mode === "template") {
|
|
1235
|
-
const c =
|
|
1242
|
+
const c = Me(
|
|
1236
1243
|
t.value,
|
|
1237
1244
|
l,
|
|
1238
1245
|
e.templateOpen,
|
|
@@ -1245,31 +1252,31 @@ const un = {
|
|
|
1245
1252
|
}
|
|
1246
1253
|
_();
|
|
1247
1254
|
}
|
|
1248
|
-
let
|
|
1249
|
-
function
|
|
1250
|
-
window.clearTimeout(
|
|
1251
|
-
|
|
1255
|
+
let $e = 0;
|
|
1256
|
+
function je() {
|
|
1257
|
+
window.clearTimeout($e), $e = window.setTimeout(() => {
|
|
1258
|
+
$e = 0, De(), X();
|
|
1252
1259
|
}, 0);
|
|
1253
1260
|
}
|
|
1254
|
-
function
|
|
1261
|
+
function Fe(t) {
|
|
1255
1262
|
t.target !== d.value && w.value && _();
|
|
1256
1263
|
}
|
|
1257
|
-
function
|
|
1258
|
-
|
|
1264
|
+
function At() {
|
|
1265
|
+
F(), j(), re.value && Bt();
|
|
1259
1266
|
}
|
|
1260
|
-
let
|
|
1261
|
-
function
|
|
1262
|
-
window.clearTimeout(
|
|
1263
|
-
|
|
1267
|
+
let Ce = 0;
|
|
1268
|
+
function Bt() {
|
|
1269
|
+
window.clearTimeout(Ce), Ce = window.setTimeout(() => {
|
|
1270
|
+
Ce = 0, Ot();
|
|
1264
1271
|
}, 120);
|
|
1265
1272
|
}
|
|
1266
|
-
function
|
|
1273
|
+
function Ot() {
|
|
1267
1274
|
const t = d.value;
|
|
1268
1275
|
if (!t) return;
|
|
1269
|
-
const l =
|
|
1270
|
-
Math.abs(p - c) < 0.5 || (t.scrollTop = p,
|
|
1276
|
+
const l = G.lineHeight, c = t.scrollTop, p = Math.round(c / l) * l;
|
|
1277
|
+
Math.abs(p - c) < 0.5 || (t.scrollTop = p, j());
|
|
1271
1278
|
}
|
|
1272
|
-
function
|
|
1279
|
+
function Nt(t) {
|
|
1273
1280
|
var h;
|
|
1274
1281
|
const l = d.value;
|
|
1275
1282
|
if (!l) return;
|
|
@@ -1280,15 +1287,15 @@ const un = {
|
|
|
1280
1287
|
}
|
|
1281
1288
|
if (w.value) {
|
|
1282
1289
|
if (t.key === "ArrowDown") {
|
|
1283
|
-
t.preventDefault(),
|
|
1290
|
+
t.preventDefault(), ze(1);
|
|
1284
1291
|
return;
|
|
1285
1292
|
}
|
|
1286
1293
|
if (t.key === "ArrowUp") {
|
|
1287
|
-
t.preventDefault(),
|
|
1294
|
+
t.preventDefault(), ze(-1);
|
|
1288
1295
|
return;
|
|
1289
1296
|
}
|
|
1290
1297
|
if (t.key === "Enter" || t.key === "Tab") {
|
|
1291
|
-
t.preventDefault(),
|
|
1298
|
+
t.preventDefault(), We();
|
|
1292
1299
|
return;
|
|
1293
1300
|
}
|
|
1294
1301
|
if (t.key === "Escape") {
|
|
@@ -1296,12 +1303,12 @@ const un = {
|
|
|
1296
1303
|
return;
|
|
1297
1304
|
}
|
|
1298
1305
|
if (p || c) {
|
|
1299
|
-
_(), p && !c &&
|
|
1306
|
+
_(), p && !c && je();
|
|
1300
1307
|
return;
|
|
1301
1308
|
}
|
|
1302
1309
|
}
|
|
1303
1310
|
if (p && !c) {
|
|
1304
|
-
|
|
1311
|
+
je();
|
|
1305
1312
|
return;
|
|
1306
1313
|
}
|
|
1307
1314
|
if (t.key === "Enter" && !c && !t.shiftKey) {
|
|
@@ -1309,83 +1316,83 @@ const un = {
|
|
|
1309
1316
|
if (m !== l.selectionEnd) return;
|
|
1310
1317
|
const x = l.value.lastIndexOf(`
|
|
1311
1318
|
`, 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(),
|
|
1319
|
+
t.preventDefault(), ue(m, m, `
|
|
1313
1320
|
${y}${C}`);
|
|
1314
1321
|
return;
|
|
1315
1322
|
}
|
|
1316
1323
|
if (t.key === "Tab") {
|
|
1317
|
-
t.preventDefault(),
|
|
1324
|
+
t.preventDefault(), ue(l.selectionStart, l.selectionEnd, " ");
|
|
1318
1325
|
return;
|
|
1319
1326
|
}
|
|
1320
1327
|
if (t.key.length === 1 && !c && !t.altKey && f[t.key]) {
|
|
1321
1328
|
if (l.selectionStart !== l.selectionEnd) return;
|
|
1322
1329
|
const m = l.selectionStart, x = l.value[m - 1], k = l.value[m];
|
|
1323
1330
|
if ((t.key === '"' || t.key === "'") && x && /[\w$]/.test(x) || k !== void 0 && !/[\s)\]},;:]/.test(k)) return;
|
|
1324
|
-
t.preventDefault(),
|
|
1331
|
+
t.preventDefault(), ue(m, m, t.key + f[t.key], m + 1), e.mode === "template" && V(() => ne(!0));
|
|
1325
1332
|
}
|
|
1326
1333
|
}
|
|
1327
|
-
function
|
|
1328
|
-
w.value && _(),
|
|
1329
|
-
|
|
1334
|
+
function Pe() {
|
|
1335
|
+
w.value && _(), F(), V(() => {
|
|
1336
|
+
ke(), j(!0);
|
|
1330
1337
|
});
|
|
1331
1338
|
}
|
|
1332
|
-
let
|
|
1333
|
-
return
|
|
1334
|
-
window.addEventListener("resize",
|
|
1335
|
-
|
|
1336
|
-
}), typeof ResizeObserver < "u" && d.value && (
|
|
1337
|
-
|
|
1338
|
-
}),
|
|
1339
|
-
}),
|
|
1340
|
-
window.removeEventListener("resize",
|
|
1339
|
+
let ee = null;
|
|
1340
|
+
return jt(() => {
|
|
1341
|
+
window.addEventListener("resize", Pe), window.addEventListener("scroll", Fe, !0), V(() => {
|
|
1342
|
+
ke(), j(!0);
|
|
1343
|
+
}), typeof ResizeObserver < "u" && d.value && (ee = new ResizeObserver(() => {
|
|
1344
|
+
j(!0), X();
|
|
1345
|
+
}), ee.observe(d.value));
|
|
1346
|
+
}), Ft(() => {
|
|
1347
|
+
window.removeEventListener("resize", Pe), window.removeEventListener("scroll", Fe, !0), ee == null || ee.disconnect(), ee = null;
|
|
1341
1348
|
}), s({ focus: () => {
|
|
1342
1349
|
var t;
|
|
1343
1350
|
return (t = d.value) == null ? void 0 : t.focus();
|
|
1344
1351
|
} }), (t, l) => (I(), H("div", {
|
|
1345
|
-
class:
|
|
1346
|
-
style:
|
|
1352
|
+
class: ie(["code-input", { "is-collapsible": n.collapsible }]),
|
|
1353
|
+
style: he(kt.value)
|
|
1347
1354
|
}, [
|
|
1348
|
-
|
|
1349
|
-
class:
|
|
1355
|
+
A("div", {
|
|
1356
|
+
class: ie(["code-editor", {
|
|
1350
1357
|
"is-readonly": n.readonly,
|
|
1351
1358
|
"is-dark": n.theme === "dark",
|
|
1352
|
-
"is-collapsed":
|
|
1353
|
-
"is-expanding":
|
|
1359
|
+
"is-collapsed": re.value,
|
|
1360
|
+
"is-expanding": ye.value
|
|
1354
1361
|
}]),
|
|
1355
|
-
style:
|
|
1356
|
-
onAnimationend:
|
|
1362
|
+
style: he(wt.value),
|
|
1363
|
+
onAnimationend: Ue(xt, ["self"])
|
|
1357
1364
|
}, [
|
|
1358
|
-
n.lineNumbers ? (I(), H("div",
|
|
1359
|
-
|
|
1365
|
+
n.lineNumbers ? (I(), H("div", hn, [
|
|
1366
|
+
A("div", {
|
|
1360
1367
|
ref_key: "gutterInner",
|
|
1361
1368
|
ref: b,
|
|
1362
1369
|
class: "gutter-inner code-font"
|
|
1363
1370
|
}, [
|
|
1364
|
-
(I(!0), H(
|
|
1371
|
+
(I(!0), H(Ye, null, Xe(yt.value, (c) => (I(), H("div", {
|
|
1365
1372
|
key: c,
|
|
1366
1373
|
class: "gutter-line"
|
|
1367
1374
|
}, Y(c), 1))), 128))
|
|
1368
1375
|
], 512)
|
|
1369
1376
|
])) : K("", !0),
|
|
1370
|
-
|
|
1377
|
+
A("div", {
|
|
1371
1378
|
ref_key: "stage",
|
|
1372
|
-
ref:
|
|
1379
|
+
ref: T,
|
|
1373
1380
|
class: "stage"
|
|
1374
1381
|
}, [
|
|
1375
|
-
|
|
1382
|
+
A("div", {
|
|
1376
1383
|
ref_key: "highlightLayer",
|
|
1377
|
-
ref:
|
|
1384
|
+
ref: D,
|
|
1378
1385
|
class: "highlight code-font"
|
|
1379
1386
|
}, [
|
|
1380
|
-
|
|
1387
|
+
A("pre", {
|
|
1381
1388
|
ref_key: "highlightInner",
|
|
1382
1389
|
ref: S,
|
|
1383
1390
|
class: "code-font"
|
|
1384
1391
|
}, [
|
|
1385
|
-
|
|
1392
|
+
A("code", { innerHTML: vt.value }, null, 8, gn)
|
|
1386
1393
|
], 512)
|
|
1387
1394
|
], 512),
|
|
1388
|
-
|
|
1395
|
+
A("textarea", {
|
|
1389
1396
|
ref_key: "textarea",
|
|
1390
1397
|
ref: d,
|
|
1391
1398
|
class: "code-font input",
|
|
@@ -1397,58 +1404,58 @@ ${y}${C}`);
|
|
|
1397
1404
|
autocapitalize: "off",
|
|
1398
1405
|
autocorrect: "off",
|
|
1399
1406
|
wrap: "off",
|
|
1400
|
-
onInput:
|
|
1401
|
-
onKeydown:
|
|
1402
|
-
onScroll:
|
|
1403
|
-
onClick:
|
|
1404
|
-
onMousemove:
|
|
1405
|
-
onMouseleave:
|
|
1406
|
-
onBlur:
|
|
1407
|
-
}, null, 40,
|
|
1407
|
+
onInput: Ht,
|
|
1408
|
+
onKeydown: Nt,
|
|
1409
|
+
onScroll: At,
|
|
1410
|
+
onClick: _t,
|
|
1411
|
+
onMousemove: Mt,
|
|
1412
|
+
onMouseleave: F,
|
|
1413
|
+
onBlur: Lt
|
|
1414
|
+
}, null, 40, bn),
|
|
1408
1415
|
w.value ? (I(), H("ul", {
|
|
1409
1416
|
key: 0,
|
|
1410
1417
|
ref_key: "popup",
|
|
1411
1418
|
ref: v,
|
|
1412
1419
|
class: "popup",
|
|
1413
|
-
style:
|
|
1414
|
-
onMousedown: l[0] || (l[0] =
|
|
1420
|
+
style: he(L.value),
|
|
1421
|
+
onMousedown: l[0] || (l[0] = Ue(() => {
|
|
1415
1422
|
}, ["prevent"]))
|
|
1416
1423
|
}, [
|
|
1417
|
-
(I(!0), H(
|
|
1424
|
+
(I(!0), H(Ye, null, Xe(N.value, (c, p) => (I(), H("li", {
|
|
1418
1425
|
key: `${c.label}-${p}`,
|
|
1419
|
-
class:
|
|
1420
|
-
onMouseenter: (h) =>
|
|
1421
|
-
onClick: (h) =>
|
|
1426
|
+
class: ie(["popup-item", { "is-active": p === R.value }]),
|
|
1427
|
+
onMouseenter: (h) => R.value = p,
|
|
1428
|
+
onClick: (h) => We(c)
|
|
1422
1429
|
}, [
|
|
1423
|
-
|
|
1424
|
-
class:
|
|
1425
|
-
}, Y(
|
|
1426
|
-
|
|
1427
|
-
c.detail ? (I(), H("span",
|
|
1428
|
-
], 42,
|
|
1430
|
+
A("span", {
|
|
1431
|
+
class: ie(["badge", `badge-${c.kind}`])
|
|
1432
|
+
}, Y(_e(c.kind)), 3),
|
|
1433
|
+
A("span", yn, Y(c.label), 1),
|
|
1434
|
+
c.detail ? (I(), H("span", kn, Y(c.detail), 1)) : K("", !0)
|
|
1435
|
+
], 42, vn))), 128))
|
|
1429
1436
|
], 36)) : K("", !0),
|
|
1430
1437
|
g.value ? (I(), H("div", {
|
|
1431
1438
|
key: 1,
|
|
1432
1439
|
ref_key: "hoverCard",
|
|
1433
1440
|
ref: W,
|
|
1434
1441
|
class: "hover-card",
|
|
1435
|
-
style:
|
|
1442
|
+
style: he(se.value)
|
|
1436
1443
|
}, [
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
class:
|
|
1440
|
-
}, Y(
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
g.value.detail ? (I(), H("span",
|
|
1444
|
+
A("div", wn, [
|
|
1445
|
+
A("span", {
|
|
1446
|
+
class: ie(["badge", `badge-${g.value.kind}`])
|
|
1447
|
+
}, Y(_e(g.value.kind)), 3),
|
|
1448
|
+
A("span", xn, [
|
|
1449
|
+
Pt(Y(g.value.label), 1),
|
|
1450
|
+
g.value.detail ? (I(), H("span", Tn, ":")) : K("", !0)
|
|
1444
1451
|
]),
|
|
1445
|
-
g.value.detail ? (I(), H("span",
|
|
1452
|
+
g.value.detail ? (I(), H("span", $n, Y(g.value.detail), 1)) : K("", !0)
|
|
1446
1453
|
]),
|
|
1447
|
-
g.value.documentation ? (I(), H("p",
|
|
1448
|
-
g.value.type ? (I(), H("pre",
|
|
1449
|
-
|
|
1450
|
-
innerHTML:
|
|
1451
|
-
}, null, 8,
|
|
1454
|
+
g.value.documentation ? (I(), H("p", Cn, Y(g.value.documentation), 1)) : K("", !0),
|
|
1455
|
+
g.value.type ? (I(), H("pre", Sn, [
|
|
1456
|
+
A("code", {
|
|
1457
|
+
innerHTML: $t(g.value.type)
|
|
1458
|
+
}, null, 8, En)
|
|
1452
1459
|
])) : K("", !0)
|
|
1453
1460
|
], 4)) : K("", !0)
|
|
1454
1461
|
], 512),
|
|
@@ -1456,12 +1463,12 @@ ${y}${C}`);
|
|
|
1456
1463
|
key: 1,
|
|
1457
1464
|
type: "button",
|
|
1458
1465
|
class: "expand-toggle",
|
|
1459
|
-
title:
|
|
1460
|
-
"aria-label":
|
|
1461
|
-
onClick:
|
|
1466
|
+
title: P.value ? "收起" : "展开",
|
|
1467
|
+
"aria-label": P.value ? "收起编辑器" : "展开编辑器",
|
|
1468
|
+
onClick: Tt
|
|
1462
1469
|
}, [
|
|
1463
|
-
|
|
1464
|
-
|
|
1470
|
+
P.value ? (I(), H("svg", In, [...l[2] || (l[2] = [
|
|
1471
|
+
A("path", {
|
|
1465
1472
|
d: "M11 2 5 8 11 14",
|
|
1466
1473
|
fill: "none",
|
|
1467
1474
|
stroke: "currentColor",
|
|
@@ -1469,8 +1476,8 @@ ${y}${C}`);
|
|
|
1469
1476
|
"stroke-linecap": "round",
|
|
1470
1477
|
"stroke-linejoin": "round"
|
|
1471
1478
|
}, null, -1)
|
|
1472
|
-
])])) : (I(), H("svg",
|
|
1473
|
-
|
|
1479
|
+
])])) : (I(), H("svg", Mn, [...l[1] || (l[1] = [
|
|
1480
|
+
A("path", {
|
|
1474
1481
|
d: "M6 2 12 8 6 14",
|
|
1475
1482
|
fill: "none",
|
|
1476
1483
|
stroke: "currentColor",
|
|
@@ -1479,35 +1486,35 @@ ${y}${C}`);
|
|
|
1479
1486
|
"stroke-linejoin": "round"
|
|
1480
1487
|
}, null, -1)
|
|
1481
1488
|
])]))
|
|
1482
|
-
], 8,
|
|
1489
|
+
], 8, Rn)) : K("", !0)
|
|
1483
1490
|
], 38)
|
|
1484
1491
|
], 6));
|
|
1485
1492
|
}
|
|
1486
|
-
}),
|
|
1493
|
+
}), Ln = (n, s) => {
|
|
1487
1494
|
const o = n.__vccOpts || n;
|
|
1488
1495
|
for (const [e, i] of s)
|
|
1489
1496
|
o[e] = i;
|
|
1490
1497
|
return o;
|
|
1491
|
-
},
|
|
1498
|
+
}, _n = /* @__PURE__ */ Ln(Hn, [["__scopeId", "data-v-3779a6df"]]), On = {
|
|
1492
1499
|
install(n) {
|
|
1493
|
-
n.component("CodeInput",
|
|
1500
|
+
n.component("CodeInput", _n);
|
|
1494
1501
|
}
|
|
1495
1502
|
};
|
|
1496
1503
|
export {
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1504
|
+
_n as CodeEditor,
|
|
1505
|
+
Qt as collectCompletions,
|
|
1506
|
+
On as default,
|
|
1507
|
+
Vt as defaultCompletions,
|
|
1508
|
+
Kt as findArgumentContext,
|
|
1509
|
+
Me as findTemplateRange,
|
|
1510
|
+
Qe as getKeywordSet,
|
|
1511
|
+
rt as getKeywords,
|
|
1512
|
+
be as highlight,
|
|
1513
|
+
mn as highlightTemplate,
|
|
1514
|
+
Bn as isInsideTemplate,
|
|
1515
|
+
cn as parseTsCompletions,
|
|
1516
|
+
un as parseTsSignatures,
|
|
1517
|
+
en as resolveHoverItem,
|
|
1518
|
+
et as scanDeclarations,
|
|
1519
|
+
ge as tokenize
|
|
1513
1520
|
};
|