@uiwwsw/virtual-keyboard 2.0.1 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -8
- package/dist/index.js +621 -694
- package/dist/types/utils/nativeEditing.d.ts +7 -0
- package/package.json +1 -1
- package/dist/types/utils/domSelection.d.ts +0 -6
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { useContext as
|
|
4
|
-
import { convertQwertyToHangul as
|
|
5
|
-
import { createPortal as
|
|
6
|
-
class
|
|
2
|
+
import { jsxs as q, jsx as T, Fragment as Me } from "react/jsx-runtime";
|
|
3
|
+
import { useContext as Oe, createContext as et, forwardRef as tt, useId as $e, useRef as I, useState as P, useMemo as He, useCallback as S, useEffect as z, useImperativeHandle as nt, useLayoutEffect as rt, createElement as at } from "react";
|
|
4
|
+
import { convertQwertyToHangul as Ue, assemble as ot, removeLastCharacter as it } from "es-hangul";
|
|
5
|
+
import { createPortal as Te } from "react-dom";
|
|
6
|
+
class ct {
|
|
7
7
|
past = [];
|
|
8
8
|
future = [];
|
|
9
9
|
record(n, r) {
|
|
@@ -21,9 +21,9 @@ class ut {
|
|
|
21
21
|
this.past = [], this.future = [];
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
|
-
const
|
|
25
|
-
function
|
|
26
|
-
const e =
|
|
24
|
+
const We = et(null);
|
|
25
|
+
function Ze() {
|
|
26
|
+
const e = Oe(We);
|
|
27
27
|
if (!e)
|
|
28
28
|
throw new Error(
|
|
29
29
|
"VirtualInput must be used within a <VirtualInputProvider>."
|
|
@@ -33,14 +33,14 @@ function _e() {
|
|
|
33
33
|
function we(e) {
|
|
34
34
|
return /^[\u1100-\u11FF\u3130-\u318F\uAC00-\uD7AF]$/.test(e);
|
|
35
35
|
}
|
|
36
|
-
function
|
|
36
|
+
function lt(e, n) {
|
|
37
37
|
if (e.key === "HangulMode") return { handled: !0, toggleHangulMode: !0 };
|
|
38
38
|
if (e.ctrlKey || e.metaKey || e.altKey || [...e.key].length !== 1 || /[\r\n\t]/.test(e.key))
|
|
39
39
|
return { handled: !1 };
|
|
40
|
-
const r = n && /^[A-Za-z]$/.test(e.key) ?
|
|
40
|
+
const r = n && /^[A-Za-z]$/.test(e.key) ? Ue(e.key) : e.key;
|
|
41
41
|
return { handled: !0, text: r, composing: we(r) };
|
|
42
42
|
}
|
|
43
|
-
const
|
|
43
|
+
const re = [
|
|
44
44
|
[
|
|
45
45
|
{
|
|
46
46
|
label: "q",
|
|
@@ -211,7 +211,7 @@ const ee = [
|
|
|
211
211
|
width: 1.25
|
|
212
212
|
}
|
|
213
213
|
]
|
|
214
|
-
],
|
|
214
|
+
], ut = [
|
|
215
215
|
[
|
|
216
216
|
{
|
|
217
217
|
label: "1",
|
|
@@ -280,7 +280,7 @@ const ee = [
|
|
|
280
280
|
type: "action"
|
|
281
281
|
}
|
|
282
282
|
]
|
|
283
|
-
],
|
|
283
|
+
], st = [
|
|
284
284
|
[
|
|
285
285
|
{
|
|
286
286
|
label: "1",
|
|
@@ -363,7 +363,7 @@ const ee = [
|
|
|
363
363
|
}
|
|
364
364
|
]
|
|
365
365
|
];
|
|
366
|
-
function
|
|
366
|
+
function me(e) {
|
|
367
367
|
switch (e) {
|
|
368
368
|
case "hangul":
|
|
369
369
|
return !0;
|
|
@@ -376,34 +376,34 @@ function ge(e) {
|
|
|
376
376
|
return null;
|
|
377
377
|
}
|
|
378
378
|
}
|
|
379
|
-
const
|
|
379
|
+
const ge = () => !0, dt = {
|
|
380
380
|
text: {
|
|
381
381
|
mode: "text",
|
|
382
|
-
layout:
|
|
383
|
-
filterKey:
|
|
382
|
+
layout: re,
|
|
383
|
+
filterKey: ge,
|
|
384
384
|
sanitizeValue: (e) => e.replace(/[\r\n\t]+/g, " ")
|
|
385
385
|
},
|
|
386
386
|
number: {
|
|
387
387
|
mode: "number",
|
|
388
|
-
layout:
|
|
388
|
+
layout: ut,
|
|
389
389
|
filterKey: (e) => /^[0-9.]+$/.test(e),
|
|
390
390
|
sanitizeValue: (e) => e.replace(/[^0-9.]/g, "")
|
|
391
391
|
},
|
|
392
392
|
tel: {
|
|
393
393
|
mode: "tel",
|
|
394
|
-
layout:
|
|
394
|
+
layout: st,
|
|
395
395
|
filterKey: (e) => /^[0-9*#+]+$/.test(e),
|
|
396
396
|
sanitizeValue: (e) => e.replace(/[^0-9*#+]/g, "")
|
|
397
397
|
},
|
|
398
398
|
hangul: {
|
|
399
399
|
mode: "hangul",
|
|
400
|
-
layout:
|
|
401
|
-
filterKey:
|
|
400
|
+
layout: re,
|
|
401
|
+
filterKey: ge,
|
|
402
402
|
sanitizeValue: (e) => e.replace(/[A-Za-z]/g, "")
|
|
403
403
|
},
|
|
404
404
|
alpha: {
|
|
405
405
|
mode: "alpha",
|
|
406
|
-
layout:
|
|
406
|
+
layout: re,
|
|
407
407
|
filterKey: (e) => /^[A-Za-z]+$/.test(e),
|
|
408
408
|
sanitizeValue: (e) => e.replace(/[^A-Za-z]/g, "")
|
|
409
409
|
},
|
|
@@ -411,64 +411,56 @@ const he = () => !0, pt = {
|
|
|
411
411
|
mode: "alphanumeric",
|
|
412
412
|
layout: [
|
|
413
413
|
Array.from("1234567890", (e) => ({ value: e })),
|
|
414
|
-
...
|
|
414
|
+
...re
|
|
415
415
|
],
|
|
416
416
|
filterKey: (e) => /^[A-Za-z0-9]+$/.test(e),
|
|
417
417
|
sanitizeValue: (e) => e.replace(/[^A-Za-z0-9]/g, "")
|
|
418
418
|
},
|
|
419
419
|
custom: {
|
|
420
420
|
mode: "custom",
|
|
421
|
-
layout:
|
|
422
|
-
filterKey:
|
|
421
|
+
layout: re,
|
|
422
|
+
filterKey: ge,
|
|
423
423
|
sanitizeValue: (e) => e.replace(/[\r\n\t]+/g, " ")
|
|
424
424
|
}
|
|
425
425
|
};
|
|
426
|
-
function
|
|
427
|
-
const n = e?.mode ?? "text", r =
|
|
426
|
+
function Se(e) {
|
|
427
|
+
const n = e?.mode ?? "text", r = dt[n];
|
|
428
428
|
return {
|
|
429
429
|
mode: n,
|
|
430
|
-
layout: e?.layout ?? r.layout ??
|
|
431
|
-
filterKey: e?.filterKey ?? r.filterKey ??
|
|
430
|
+
layout: e?.layout ?? r.layout ?? re,
|
|
431
|
+
filterKey: e?.filterKey ?? r.filterKey ?? ge,
|
|
432
432
|
sanitizeValue: e?.sanitizeValue ?? r.sanitizeValue ?? ((a) => a)
|
|
433
433
|
};
|
|
434
434
|
}
|
|
435
|
-
const
|
|
436
|
-
function
|
|
437
|
-
const r = Math.max(0, Math.min(n, e.length - 1));
|
|
438
|
-
for (const a of gt.segment(e))
|
|
439
|
-
if (r < a.index + a.segment.length)
|
|
440
|
-
return [a.index, a.index + a.segment.length];
|
|
441
|
-
return [0, 0];
|
|
442
|
-
}
|
|
443
|
-
const me = (e) => Array.from(ht.segment(e));
|
|
444
|
-
function oe(e, n) {
|
|
435
|
+
const ft = new Intl.Segmenter(void 0, { granularity: "grapheme" }), Ve = (e) => Array.from(ft.segment(e));
|
|
436
|
+
function Z(e, n) {
|
|
445
437
|
return [
|
|
446
|
-
...
|
|
438
|
+
...Ve(e).map((a) => a.index),
|
|
447
439
|
e.length
|
|
448
440
|
].filter((a) => a <= Math.max(0, n)).at(-1) ?? 0;
|
|
449
441
|
}
|
|
450
|
-
function
|
|
442
|
+
function Le(e, n, r) {
|
|
451
443
|
const a = [
|
|
452
|
-
...
|
|
444
|
+
...Ve(e).map((i) => i.index),
|
|
453
445
|
e.length
|
|
454
446
|
];
|
|
455
447
|
return r < 0 ? a.filter((i) => i < n).at(-1) ?? 0 : a.find((i) => i > n) ?? e.length;
|
|
456
448
|
}
|
|
457
|
-
const
|
|
458
|
-
function
|
|
459
|
-
const [i, s] =
|
|
460
|
-
let
|
|
461
|
-
i === s && e.composing && r && we(
|
|
462
|
-
const
|
|
463
|
-
if (a !== void 0 &&
|
|
464
|
-
const
|
|
465
|
-
return { value:
|
|
449
|
+
const ae = ({ anchor: e, caret: n }) => [Math.min(e, n), Math.max(e, n)];
|
|
450
|
+
function qe(e, n, r = !1, a) {
|
|
451
|
+
const [i, s] = ae(e);
|
|
452
|
+
let f = e.value.slice(0, i), v = n;
|
|
453
|
+
i === s && e.composing && r && we(f.at(-1) ?? "") && (v = ot([f.at(-1), n]), f = f.slice(0, -1));
|
|
454
|
+
const c = f + v + e.value.slice(s);
|
|
455
|
+
if (a !== void 0 && c.length > a) return e;
|
|
456
|
+
const m = f.length + v.length;
|
|
457
|
+
return { value: c, caret: m, anchor: m, composing: r };
|
|
466
458
|
}
|
|
467
|
-
function
|
|
468
|
-
let [r, a] =
|
|
459
|
+
function ve(e, n) {
|
|
460
|
+
let [r, a] = ae(e);
|
|
469
461
|
if (r === a) {
|
|
470
462
|
if (n < 0 && e.composing && we(e.value[r - 1] ?? "")) {
|
|
471
|
-
const i = e.value.slice(0, r - 1) +
|
|
463
|
+
const i = e.value.slice(0, r - 1) + it(e.value[r - 1]);
|
|
472
464
|
return {
|
|
473
465
|
value: i + e.value.slice(a),
|
|
474
466
|
anchor: i.length,
|
|
@@ -476,7 +468,7 @@ function ke(e, n) {
|
|
|
476
468
|
composing: !0
|
|
477
469
|
};
|
|
478
470
|
}
|
|
479
|
-
n < 0 ? r =
|
|
471
|
+
n < 0 ? r = Le(e.value, r, -1) : a = Le(e.value, a, 1);
|
|
480
472
|
}
|
|
481
473
|
return {
|
|
482
474
|
value: e.value.slice(0, r) + e.value.slice(a),
|
|
@@ -485,8 +477,8 @@ function ke(e, n) {
|
|
|
485
477
|
composing: !1
|
|
486
478
|
};
|
|
487
479
|
}
|
|
488
|
-
function
|
|
489
|
-
const [a, i] =
|
|
480
|
+
function Fe(e, n, r = !1) {
|
|
481
|
+
const [a, i] = ae(e), s = n === "home" ? 0 : n === "end" ? e.value.length : !r && a !== i ? n < 0 ? a : i : Le(e.value, e.caret, n);
|
|
490
482
|
return {
|
|
491
483
|
...e,
|
|
492
484
|
caret: s,
|
|
@@ -494,279 +486,271 @@ function je(e, n, r = !1) {
|
|
|
494
486
|
composing: !1
|
|
495
487
|
};
|
|
496
488
|
}
|
|
497
|
-
function
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
489
|
+
function pt(e, n, r, a, i, s) {
|
|
490
|
+
if (n === e.value) return e;
|
|
491
|
+
let f = 0;
|
|
492
|
+
for (; f < e.value.length && f < n.length && e.value[f] === n[f]; )
|
|
493
|
+
f++;
|
|
494
|
+
f = Math.min(
|
|
495
|
+
Z(e.value, f),
|
|
496
|
+
Z(n, f)
|
|
497
|
+
);
|
|
498
|
+
let v = e.value.length, c = n.length;
|
|
499
|
+
for (; v > f && c > f && e.value[v - 1] === n[c - 1]; )
|
|
500
|
+
v--, c--;
|
|
501
|
+
for (; Z(e.value, v) !== v || Z(n, c) !== c; )
|
|
502
|
+
v < e.value.length && v++, c < n.length && c++;
|
|
503
|
+
const m = n.slice(f, c), p = a(m).replace(/[\r\n\t]+/g, " ");
|
|
504
|
+
if (m && (!p || !i(p))) return e;
|
|
505
|
+
const l = { ...e, anchor: f, caret: v, composing: !1 }, u = m ? qe(l, p, !1, s) : ve(l, -1);
|
|
506
|
+
if (u === l) return e;
|
|
507
|
+
const V = (w) => Z(
|
|
508
|
+
u.value,
|
|
509
|
+
w <= f ? w : w >= c ? w + p.length - m.length : f + a(m.slice(0, w - f)).replace(/[\r\n\t]+/g, " ").length
|
|
510
|
+
);
|
|
508
511
|
return {
|
|
509
|
-
|
|
510
|
-
|
|
512
|
+
...u,
|
|
513
|
+
anchor: V(r.backward ? r.end : r.start),
|
|
514
|
+
caret: V(r.backward ? r.start : r.end)
|
|
511
515
|
};
|
|
512
516
|
}
|
|
513
|
-
|
|
514
|
-
const a = e.ownerDocument.getSelection();
|
|
515
|
-
if (!a) return;
|
|
516
|
-
const i = Ae(e);
|
|
517
|
-
if (i?.anchor === n && i.caret === r) return;
|
|
518
|
-
const s = (p) => {
|
|
519
|
-
const l = e.ownerDocument.createTreeWalker(
|
|
520
|
-
e,
|
|
521
|
-
NodeFilter.SHOW_TEXT
|
|
522
|
-
);
|
|
523
|
-
let u = l.nextNode(), P = p;
|
|
524
|
-
for (; u; ) {
|
|
525
|
-
const w = u.textContent?.length ?? 0;
|
|
526
|
-
if (P <= w) return [u, P];
|
|
527
|
-
P -= w, u = l.nextNode();
|
|
528
|
-
}
|
|
529
|
-
return [e, e.childNodes.length];
|
|
530
|
-
}, [m, v] = s(n), [d, k] = s(r);
|
|
531
|
-
a.setBaseAndExtent(m, v, d, k);
|
|
532
|
-
}
|
|
533
|
-
const Xe = typeof window > "u" ? K : at, Dt = rt(
|
|
517
|
+
const ht = typeof window > "u" ? z : rt, Mt = tt(
|
|
534
518
|
function({
|
|
535
519
|
value: n,
|
|
536
520
|
defaultValue: r = "",
|
|
537
521
|
placeholder: a,
|
|
538
522
|
onChange: i,
|
|
539
523
|
onValueChange: s,
|
|
540
|
-
onClipboardError:
|
|
524
|
+
onClipboardError: f,
|
|
541
525
|
mode: v = "text",
|
|
542
|
-
layout:
|
|
543
|
-
filterKey:
|
|
526
|
+
layout: c,
|
|
527
|
+
filterKey: m,
|
|
544
528
|
sanitizeValue: p,
|
|
545
529
|
disabled: l = !1,
|
|
546
530
|
readOnly: u = !1,
|
|
547
|
-
maxLength:
|
|
531
|
+
maxLength: V,
|
|
548
532
|
...w
|
|
549
|
-
},
|
|
550
|
-
const
|
|
551
|
-
focusId:
|
|
552
|
-
onFocus:
|
|
533
|
+
}, Q) {
|
|
534
|
+
const H = $e(), {
|
|
535
|
+
focusId: le,
|
|
536
|
+
onFocus: te,
|
|
553
537
|
onBlur: F,
|
|
554
|
-
defaultLayout:
|
|
538
|
+
defaultLayout: oe,
|
|
555
539
|
inputRef: X,
|
|
556
|
-
hangulMode:
|
|
557
|
-
theme:
|
|
558
|
-
toggleKorean:
|
|
559
|
-
setEditingStatus:
|
|
560
|
-
} =
|
|
540
|
+
hangulMode: J,
|
|
541
|
+
theme: ue,
|
|
542
|
+
toggleKorean: g,
|
|
543
|
+
setEditingStatus: L
|
|
544
|
+
} = Ze(), y = I(null), A = I(null), x = I(!1), B = I(!1), R = I(null), [Y, N] = P(null), [b, O] = P(!1), [U, de] = P(() => ({
|
|
561
545
|
value: n ?? r,
|
|
562
546
|
caret: (n ?? r).length,
|
|
563
547
|
anchor: (n ?? r).length,
|
|
564
548
|
composing: !1
|
|
565
|
-
})),
|
|
566
|
-
|
|
567
|
-
const
|
|
568
|
-
|
|
569
|
-
...
|
|
570
|
-
value:
|
|
571
|
-
caret:
|
|
572
|
-
anchor:
|
|
573
|
-
composing:
|
|
549
|
+
})), W = n ?? U.value, d = I(U), ne = I(0), ie = I(new ct()), G = I(!1), h = le === H, k = I(h);
|
|
550
|
+
k.current = h;
|
|
551
|
+
const $ = n !== void 0 && n !== U.value;
|
|
552
|
+
$ && ie.current.clear(), d.current = {
|
|
553
|
+
...U,
|
|
554
|
+
value: W,
|
|
555
|
+
caret: Z(W, U.caret),
|
|
556
|
+
anchor: Z(W, U.anchor),
|
|
557
|
+
composing: $ ? !1 : U.composing
|
|
574
558
|
};
|
|
575
|
-
const j =
|
|
576
|
-
() =>
|
|
559
|
+
const j = He(
|
|
560
|
+
() => Se({
|
|
577
561
|
mode: v,
|
|
578
|
-
layout:
|
|
579
|
-
filterKey:
|
|
562
|
+
layout: c ?? (v === "text" || v === "custom" ? oe : void 0),
|
|
563
|
+
filterKey: m,
|
|
580
564
|
sanitizeValue: p
|
|
581
565
|
}),
|
|
582
|
-
[v,
|
|
583
|
-
), [
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
}, []);
|
|
588
|
-
K(() => {
|
|
589
|
-
(l || u) && z();
|
|
590
|
-
}, [l, u, z]), K(() => {
|
|
591
|
-
const t = (o) => {
|
|
592
|
-
R.current && R.current.id !== o.pointerId && z();
|
|
593
|
-
};
|
|
594
|
-
return window.addEventListener("blur", z), window.addEventListener("scroll", z, !0), window.addEventListener("pointerdown", t, !0), document.addEventListener("visibilitychange", z), () => {
|
|
595
|
-
z(), window.removeEventListener("blur", z), window.removeEventListener("scroll", z, !0), window.removeEventListener("pointerdown", t, !0), document.removeEventListener("visibilitychange", z);
|
|
596
|
-
};
|
|
597
|
-
}, [z]);
|
|
598
|
-
const S = E(
|
|
599
|
-
(t, o = !0, f = !1) => {
|
|
600
|
-
const x = c.current.value;
|
|
601
|
-
if (o && ne.current.record(c.current, t), U.current = !f, c.current = t, W.current++, D(""), J(t), t.value !== x) {
|
|
566
|
+
[v, c, oe, m, p]
|
|
567
|
+
), [ye, fe] = P(""), E = S(
|
|
568
|
+
(t, o = !0, C = !1) => {
|
|
569
|
+
const K = d.current.value;
|
|
570
|
+
if (o && ie.current.record(d.current, t), x.current = !C, d.current = t, ne.current++, fe(""), de(t), t.value !== K) {
|
|
602
571
|
s?.(t.value);
|
|
603
|
-
const
|
|
572
|
+
const M = { value: t.value };
|
|
604
573
|
i?.({
|
|
605
|
-
target:
|
|
606
|
-
currentTarget:
|
|
574
|
+
target: M,
|
|
575
|
+
currentTarget: M
|
|
607
576
|
});
|
|
608
577
|
}
|
|
609
578
|
},
|
|
610
579
|
[i, s]
|
|
611
|
-
),
|
|
580
|
+
), D = S(() => {
|
|
612
581
|
const t = A.current;
|
|
613
|
-
if (!t || l ||
|
|
582
|
+
if (!t || l || x.current || t.value !== d.current.value || B.current)
|
|
614
583
|
return null;
|
|
615
|
-
const o =
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
return (f !== c.current.anchor || x !== c.current.caret || f !== o.anchor || x !== o.caret) && S(
|
|
619
|
-
{ ...c.current, anchor: f, caret: x, composing: !1 },
|
|
584
|
+
const o = t.selectionStart ?? 0, C = t.selectionEnd ?? o, K = t.selectionDirection === "backward" ? { anchor: C, caret: o } : { anchor: o, caret: C }, M = Z(d.current.value, K.anchor), _ = Z(d.current.value, K.caret);
|
|
585
|
+
return (M !== d.current.anchor || _ !== d.current.caret || M !== K.anchor || _ !== K.caret) && E(
|
|
586
|
+
{ ...d.current, anchor: M, caret: _, composing: !1 },
|
|
620
587
|
!1,
|
|
621
|
-
|
|
622
|
-
), { anchor:
|
|
623
|
-
}, [l,
|
|
624
|
-
|
|
588
|
+
M === K.anchor && _ === K.caret
|
|
589
|
+
), { anchor: M, caret: _ };
|
|
590
|
+
}, [l, E]);
|
|
591
|
+
z(() => {
|
|
625
592
|
const t = () => {
|
|
626
|
-
|
|
627
|
-
|
|
593
|
+
document.activeElement === A.current && D();
|
|
594
|
+
}, o = A.current;
|
|
595
|
+
return document.addEventListener("selectionchange", t), o?.addEventListener("select", t), () => {
|
|
596
|
+
document.removeEventListener("selectionchange", t), o?.removeEventListener("select", t);
|
|
628
597
|
};
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
A.current,
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
message: y
|
|
598
|
+
}, [D]), ht(() => {
|
|
599
|
+
if (R.current && R.current.value !== W && (B.current = !1, R.current = null, N(null)), !l && A.current && !B.current && (x.current || $)) {
|
|
600
|
+
const { anchor: t, caret: o } = d.current, C = Math.min(t, o), K = Math.max(t, o), M = t > o ? "backward" : "forward";
|
|
601
|
+
(A.current.selectionStart !== C || A.current.selectionEnd !== K || C !== K && A.current.selectionDirection !== M) && A.current.setSelectionRange(C, K, M);
|
|
602
|
+
}
|
|
603
|
+
x.current = !1;
|
|
604
|
+
}), z(() => {
|
|
605
|
+
if (!h) return;
|
|
606
|
+
const [t, o] = ae(d.current);
|
|
607
|
+
L({
|
|
608
|
+
selectionLength: Ve(W.slice(t, o)).length,
|
|
609
|
+
hasValue: !!W,
|
|
610
|
+
message: ye
|
|
643
611
|
});
|
|
644
612
|
}, [
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
613
|
+
W,
|
|
614
|
+
U.anchor,
|
|
615
|
+
U.caret,
|
|
616
|
+
ye,
|
|
617
|
+
h,
|
|
618
|
+
L
|
|
651
619
|
]);
|
|
652
|
-
const
|
|
620
|
+
const ce = S(
|
|
653
621
|
(t, o = !1) => {
|
|
654
622
|
if (l || u) return;
|
|
655
|
-
|
|
656
|
-
const
|
|
657
|
-
|
|
623
|
+
D();
|
|
624
|
+
const C = j.sanitizeValue(t).replace(/[\r\n\t]+/g, " ");
|
|
625
|
+
C && E(qe(d.current, C, o, V));
|
|
658
626
|
},
|
|
659
|
-
[l, u, j,
|
|
660
|
-
),
|
|
661
|
-
!l && !u &&
|
|
662
|
-
}, [l, u,
|
|
663
|
-
!l && !u &&
|
|
664
|
-
}, [l, u,
|
|
665
|
-
() =>
|
|
666
|
-
...
|
|
667
|
-
caret:
|
|
627
|
+
[l, u, j, V, E, D]
|
|
628
|
+
), be = S(() => {
|
|
629
|
+
!l && !u && E(ie.current.undo(d.current), !1);
|
|
630
|
+
}, [l, u, E]), xe = S(() => {
|
|
631
|
+
!l && !u && E(ie.current.redo(d.current), !1);
|
|
632
|
+
}, [l, u, E]), Ke = S(
|
|
633
|
+
() => E({
|
|
634
|
+
...d.current,
|
|
635
|
+
caret: d.current.value.length,
|
|
668
636
|
anchor: 0,
|
|
669
637
|
composing: !1
|
|
670
638
|
}),
|
|
671
|
-
[
|
|
672
|
-
),
|
|
639
|
+
[E]
|
|
640
|
+
), Ie = S(
|
|
673
641
|
(t, o = !1) => {
|
|
674
|
-
|
|
642
|
+
D(), E(Fe(d.current, t === "left" ? -1 : 1, o));
|
|
675
643
|
},
|
|
676
|
-
[
|
|
677
|
-
),
|
|
678
|
-
if (w.onKeyDown?.(t), t.defaultPrevented || l)
|
|
679
|
-
|
|
644
|
+
[E, D]
|
|
645
|
+
), Ye = (t) => {
|
|
646
|
+
if (w.onKeyDown?.(t), t.defaultPrevented || l || B.current || t.nativeEvent.isComposing || t.keyCode === 229)
|
|
647
|
+
return;
|
|
648
|
+
D();
|
|
680
649
|
const o = t.key;
|
|
681
650
|
if (o === "Escape") {
|
|
682
|
-
t.preventDefault(),
|
|
651
|
+
t.preventDefault(), E({ ...d.current, composing: !1 }), F(!0), A.current?.blur();
|
|
683
652
|
return;
|
|
684
653
|
}
|
|
685
654
|
if (o === "HangulMode") {
|
|
686
|
-
t.preventDefault(),
|
|
655
|
+
t.preventDefault(), E({ ...d.current, composing: !1 }), g();
|
|
687
656
|
return;
|
|
688
657
|
}
|
|
689
|
-
const
|
|
690
|
-
if (
|
|
691
|
-
t.preventDefault(), o.toLowerCase() === "y" || t.shiftKey ?
|
|
658
|
+
const C = t.ctrlKey || t.metaKey;
|
|
659
|
+
if (C && ["z", "y"].includes(o.toLowerCase())) {
|
|
660
|
+
t.preventDefault(), o.toLowerCase() === "y" || t.shiftKey ? xe() : be();
|
|
692
661
|
return;
|
|
693
662
|
}
|
|
694
|
-
if (
|
|
695
|
-
t.preventDefault(),
|
|
696
|
-
...
|
|
697
|
-
caret:
|
|
663
|
+
if (C && o.toLowerCase() === "a") {
|
|
664
|
+
t.preventDefault(), E({
|
|
665
|
+
...d.current,
|
|
666
|
+
caret: d.current.value.length,
|
|
698
667
|
anchor: 0,
|
|
699
668
|
composing: !1
|
|
700
669
|
});
|
|
701
670
|
return;
|
|
702
671
|
}
|
|
703
|
-
const
|
|
704
|
-
if (
|
|
705
|
-
t.preventDefault(),
|
|
672
|
+
const K = o === "Home" || o === "ArrowUp" || C && o === "ArrowLeft" ? "home" : o === "End" || o === "ArrowDown" || C && o === "ArrowRight" ? "end" : o === "ArrowLeft" ? -1 : o === "ArrowRight" ? 1 : null;
|
|
673
|
+
if (K !== null) {
|
|
674
|
+
t.preventDefault(), E(Fe(d.current, K, t.shiftKey));
|
|
706
675
|
return;
|
|
707
676
|
}
|
|
708
677
|
if (o === "Tab" || o === "Enter") {
|
|
709
|
-
|
|
678
|
+
o === "Enter" && t.preventDefault(), E({ ...d.current, composing: !1 });
|
|
710
679
|
return;
|
|
711
680
|
}
|
|
712
681
|
if (u) return;
|
|
713
682
|
if (o === "Backspace" || o === "Delete") {
|
|
714
|
-
t.preventDefault(),
|
|
683
|
+
t.preventDefault(), E(ve(d.current, o === "Backspace" ? -1 : 1));
|
|
715
684
|
return;
|
|
716
685
|
}
|
|
717
|
-
const
|
|
686
|
+
const M = lt(
|
|
718
687
|
t,
|
|
719
|
-
|
|
688
|
+
me(j.mode) ?? J
|
|
720
689
|
);
|
|
721
|
-
|
|
722
|
-
},
|
|
690
|
+
M.handled && M.text && (t.preventDefault(), j.filterKey(M.text) && ce(M.text, M.composing));
|
|
691
|
+
}, pe = S(
|
|
723
692
|
(t) => {
|
|
724
693
|
const o = t instanceof Error ? t : new Error(String(t));
|
|
725
|
-
G.current && (
|
|
726
|
-
"클립보드에 접근할 수 없습니다.
|
|
727
|
-
),
|
|
694
|
+
G.current && (fe(
|
|
695
|
+
"클립보드에 접근할 수 없습니다. 입력란을 길게 눌러 기본 편집 메뉴를 사용해 주세요."
|
|
696
|
+
), f?.(o));
|
|
728
697
|
},
|
|
729
|
-
[
|
|
730
|
-
),
|
|
731
|
-
|
|
732
|
-
const [t, o] =
|
|
698
|
+
[f]
|
|
699
|
+
), he = S(async () => {
|
|
700
|
+
D();
|
|
701
|
+
const [t, o] = ae(d.current);
|
|
733
702
|
if (t === o) return;
|
|
734
|
-
const
|
|
703
|
+
const C = d.current.value, K = d.current.value.slice(t, o);
|
|
735
704
|
try {
|
|
736
705
|
if (!navigator.clipboard?.writeText)
|
|
737
706
|
throw new Error("Clipboard API unavailable");
|
|
738
|
-
await navigator.clipboard.writeText(
|
|
739
|
-
} catch (
|
|
740
|
-
|
|
741
|
-
|
|
707
|
+
await navigator.clipboard.writeText(K);
|
|
708
|
+
} catch (M) {
|
|
709
|
+
D();
|
|
710
|
+
const _ = A.current, [Ge, Qe] = ae(d.current);
|
|
711
|
+
if (!_ || !G.current || d.current.value !== C || Ge !== t || Qe !== o)
|
|
712
|
+
throw M;
|
|
713
|
+
let ee = document.activeElement;
|
|
714
|
+
const Re = ee?.hasAttribute(
|
|
715
|
+
"data-virtual-keypad"
|
|
716
|
+
);
|
|
717
|
+
if (ee !== _ && !Re) throw M;
|
|
718
|
+
for (; ee?.shadowRoot?.activeElement; )
|
|
719
|
+
ee = ee.shadowRoot.activeElement;
|
|
720
|
+
_.focus({ preventScroll: !0 });
|
|
721
|
+
try {
|
|
722
|
+
if (!document.execCommand?.("copy")) throw M;
|
|
723
|
+
} finally {
|
|
724
|
+
ee instanceof HTMLElement && ee !== _ && Re && ee.focus({ preventScroll: !0 });
|
|
725
|
+
}
|
|
742
726
|
}
|
|
743
|
-
G.current &&
|
|
744
|
-
}, [
|
|
727
|
+
G.current && fe("복사했어요");
|
|
728
|
+
}, [D]), Pe = S(async () => {
|
|
745
729
|
if (l || u) return;
|
|
746
|
-
|
|
747
|
-
const t =
|
|
748
|
-
t.anchor !== t.caret && (await
|
|
749
|
-
}, [l, u,
|
|
730
|
+
D();
|
|
731
|
+
const t = d.current, o = ne.current;
|
|
732
|
+
t.anchor !== t.caret && (await he(), G.current && k.current && ne.current === o && d.current.value === t.value && E(ve(t, -1)));
|
|
733
|
+
}, [l, u, he, E, D]), De = S(async () => {
|
|
750
734
|
if (l || u) return;
|
|
751
|
-
|
|
752
|
-
const t =
|
|
753
|
-
G.current &&
|
|
754
|
-
}, [l, u,
|
|
735
|
+
D();
|
|
736
|
+
const t = ne.current, o = d.current.value, C = await navigator.clipboard.readText();
|
|
737
|
+
G.current && k.current && ne.current === t && d.current.value === o && ce(C);
|
|
738
|
+
}, [l, u, ce, D]), se = He(
|
|
755
739
|
() => ({
|
|
756
740
|
focus: (t) => {
|
|
757
|
-
l ||
|
|
741
|
+
l || A.current?.focus(t);
|
|
758
742
|
},
|
|
759
743
|
blur: () => {
|
|
760
|
-
|
|
744
|
+
A.current?.blur(), k.current && F(!0);
|
|
761
745
|
},
|
|
762
|
-
getValue: () =>
|
|
763
|
-
setSelectionRange: (t, o) =>
|
|
764
|
-
...
|
|
765
|
-
anchor:
|
|
766
|
-
caret:
|
|
746
|
+
getValue: () => d.current.value,
|
|
747
|
+
setSelectionRange: (t, o) => E({
|
|
748
|
+
...d.current,
|
|
749
|
+
anchor: Z(d.current.value, t),
|
|
750
|
+
caret: Z(d.current.value, o),
|
|
767
751
|
composing: !1
|
|
768
752
|
}),
|
|
769
|
-
handleKeyDown: (t) =>
|
|
753
|
+
handleKeyDown: (t) => A.current?.dispatchEvent(
|
|
770
754
|
new KeyboardEvent("keydown", {
|
|
771
755
|
key: t.key,
|
|
772
756
|
shiftKey: t.shiftKey,
|
|
@@ -779,153 +763,90 @@ const Xe = typeof window > "u" ? K : at, Dt = rt(
|
|
|
779
763
|
})
|
|
780
764
|
),
|
|
781
765
|
insertText: (t, o) => {
|
|
782
|
-
j.filterKey(t) &&
|
|
766
|
+
j.filterKey(t) && ce(t, o);
|
|
783
767
|
},
|
|
784
|
-
scrollIntoView: () =>
|
|
785
|
-
moveCaret:
|
|
786
|
-
undo:
|
|
787
|
-
redo:
|
|
788
|
-
selectAll:
|
|
789
|
-
copySelection: () =>
|
|
790
|
-
pasteClipboard: () =>
|
|
791
|
-
cutSelection: () =>
|
|
768
|
+
scrollIntoView: () => y.current?.scrollIntoView({ block: "nearest", inline: "nearest" }),
|
|
769
|
+
moveCaret: Ie,
|
|
770
|
+
undo: be,
|
|
771
|
+
redo: xe,
|
|
772
|
+
selectAll: Ke,
|
|
773
|
+
copySelection: () => he().catch(pe),
|
|
774
|
+
pasteClipboard: () => De().catch(pe),
|
|
775
|
+
cutSelection: () => Pe().catch(pe)
|
|
792
776
|
}),
|
|
793
777
|
[
|
|
794
778
|
j,
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
ze,
|
|
799
|
-
Ve,
|
|
800
|
-
de,
|
|
801
|
-
ve,
|
|
802
|
-
ye,
|
|
779
|
+
ce,
|
|
780
|
+
Ie,
|
|
781
|
+
he,
|
|
803
782
|
De,
|
|
783
|
+
Pe,
|
|
784
|
+
pe,
|
|
785
|
+
be,
|
|
786
|
+
xe,
|
|
787
|
+
Ke,
|
|
804
788
|
l,
|
|
805
789
|
F,
|
|
806
|
-
|
|
790
|
+
E
|
|
807
791
|
]
|
|
808
792
|
);
|
|
809
|
-
|
|
810
|
-
|
|
793
|
+
nt(Q, () => se, [se]), z(() => {
|
|
794
|
+
h || de(
|
|
811
795
|
(t) => t.composing ? { ...t, composing: !1 } : t
|
|
812
796
|
);
|
|
813
|
-
}, [
|
|
814
|
-
if (!(!
|
|
815
|
-
return X.current =
|
|
816
|
-
X.current ===
|
|
797
|
+
}, [h]), z(() => {
|
|
798
|
+
if (!(!h || l || u))
|
|
799
|
+
return X.current = se, () => {
|
|
800
|
+
X.current === se && (X.current = null);
|
|
817
801
|
};
|
|
818
|
-
}, [
|
|
819
|
-
|
|
820
|
-
}, [
|
|
821
|
-
G.current = !1,
|
|
822
|
-
}), [F])
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
), pe = ($e ?? x).getBoundingClientRect(), se = $e || !c.current.value ? pe.left : pe.right;
|
|
829
|
-
Object.assign(I.current.style, {
|
|
830
|
-
left: `${se - N.left + f.scrollLeft - f.clientLeft}px`,
|
|
831
|
-
top: `${pe.top - N.top + f.scrollTop - f.clientTop}px`,
|
|
832
|
-
height: `${pe.height}px`
|
|
833
|
-
}), !(!V || c.current.anchor !== c.current.caret) && (se > N.right - 12 ? f.scrollLeft += se - N.right + 12 : se < N.left + 12 && (f.scrollLeft -= N.left + 12 - se));
|
|
834
|
-
};
|
|
835
|
-
t();
|
|
836
|
-
const o = typeof ResizeObserver > "u" ? null : new ResizeObserver(t);
|
|
837
|
-
return o?.observe(g.current), () => o?.disconnect();
|
|
838
|
-
}, [M, C.caret, C.anchor, V]);
|
|
839
|
-
const Ne = (t, o) => {
|
|
840
|
-
if (o ? w.onCut?.(t) : w.onCopy?.(t), t.defaultPrevented || l || o && u) return;
|
|
841
|
-
const f = document.getSelection();
|
|
842
|
-
if (f && !f.isCollapsed && A.current && !Ae(A.current))
|
|
843
|
-
return;
|
|
844
|
-
H();
|
|
845
|
-
const [x, N] = te(c.current);
|
|
846
|
-
x !== N && (t.preventDefault(), t.clipboardData.setData(
|
|
802
|
+
}, [h, l, u, se, X]), z(() => {
|
|
803
|
+
h && y.current && (l || u ? F(!0) : te(H, y.current, j));
|
|
804
|
+
}, [h, l, u, H, j, te, F]), z(() => (G.current = !0, () => {
|
|
805
|
+
G.current = !1, k.current && F(!0);
|
|
806
|
+
}), [F]);
|
|
807
|
+
const ze = (t, o) => {
|
|
808
|
+
if (o ? w.onCut?.(t) : w.onCopy?.(t), t.defaultPrevented || l || o && u || t.target !== A.current) return;
|
|
809
|
+
D();
|
|
810
|
+
const [C, K] = ae(d.current);
|
|
811
|
+
C !== K && (t.preventDefault(), t.clipboardData.setData(
|
|
847
812
|
"text/plain",
|
|
848
|
-
|
|
849
|
-
), o ?
|
|
850
|
-
}, be = (t, o = !0) => {
|
|
851
|
-
for (const f of g.current?.querySelectorAll(
|
|
852
|
-
"[data-char-index]"
|
|
853
|
-
) ?? []) {
|
|
854
|
-
const x = f.getBoundingClientRect();
|
|
855
|
-
if (t < x.left + x.width * (o ? 0.5 : 1))
|
|
856
|
-
return Number(f.dataset.charIndex);
|
|
857
|
-
}
|
|
858
|
-
return c.current.value.length;
|
|
859
|
-
}, xe = () => {
|
|
860
|
-
g.current?.focus({ preventScroll: !0 }), !u && g.current && Z(B, g.current, j);
|
|
813
|
+
d.current.value.slice(C, K)
|
|
814
|
+
), o ? E(ve(d.current, -1)) : fe("복사했어요"));
|
|
861
815
|
}, Be = (t) => {
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
if (R.current || t.isPrimary === !1) {
|
|
871
|
-
z();
|
|
872
|
-
return;
|
|
873
|
-
}
|
|
874
|
-
const f = be(t.clientX), x = t.shiftKey ? c.current.anchor : f;
|
|
875
|
-
R.current = {
|
|
876
|
-
id: t.pointerId,
|
|
877
|
-
x: t.clientX,
|
|
878
|
-
y: t.clientY,
|
|
879
|
-
anchor: x,
|
|
880
|
-
mouse: o,
|
|
881
|
-
held: !1
|
|
882
|
-
}, clearTimeout(q.current), o ? xe() : q.current = setTimeout(() => {
|
|
883
|
-
R.current && (R.current.held = !0, Be(R.current.x));
|
|
884
|
-
}, 550);
|
|
885
|
-
}, [Re, He] = te(c.current), Oe = me(M), et = /* @__PURE__ */ L(
|
|
886
|
-
"span",
|
|
887
|
-
{
|
|
888
|
-
ref: I,
|
|
889
|
-
"aria-hidden": "true",
|
|
890
|
-
className: "vk-caret",
|
|
891
|
-
style: {
|
|
892
|
-
display: V && !u && !l && Re === He ? "block" : "none",
|
|
893
|
-
width: 0,
|
|
894
|
-
height: "1.1em",
|
|
895
|
-
position: "absolute",
|
|
896
|
-
pointerEvents: "none",
|
|
897
|
-
userSelect: "none"
|
|
816
|
+
if (l || u) return;
|
|
817
|
+
const o = pt(
|
|
818
|
+
d.current,
|
|
819
|
+
t.value,
|
|
820
|
+
{
|
|
821
|
+
start: t.selectionStart ?? t.value.length,
|
|
822
|
+
end: t.selectionEnd ?? t.value.length,
|
|
823
|
+
backward: t.selectionDirection === "backward"
|
|
898
824
|
},
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
825
|
+
j.sanitizeValue,
|
|
826
|
+
j.filterKey,
|
|
827
|
+
V
|
|
828
|
+
);
|
|
829
|
+
t.value = o.value, E({ ...o });
|
|
830
|
+
}, _e = Object.fromEntries(
|
|
831
|
+
Object.entries(w).filter(([t]) => t.startsWith("aria-"))
|
|
832
|
+
), Je = Object.fromEntries(
|
|
833
|
+
Object.entries(w).filter(
|
|
834
|
+
([t]) => !t.startsWith("aria-") && !["id", "tabIndex", "role", "contentEditable", "children"].includes(
|
|
835
|
+
t
|
|
908
836
|
)
|
|
909
|
-
|
|
837
|
+
)
|
|
910
838
|
);
|
|
911
|
-
return /* @__PURE__ */
|
|
839
|
+
return /* @__PURE__ */ q(
|
|
912
840
|
"div",
|
|
913
841
|
{
|
|
914
|
-
...
|
|
915
|
-
ref:
|
|
916
|
-
id: w.id ?? B,
|
|
917
|
-
role: "textbox",
|
|
918
|
-
tabIndex: l ? -1 : w.tabIndex ?? 0,
|
|
919
|
-
"aria-disabled": l || void 0,
|
|
920
|
-
"aria-readonly": u || void 0,
|
|
921
|
-
"aria-multiline": "false",
|
|
922
|
-
"aria-placeholder": a,
|
|
842
|
+
...Je,
|
|
843
|
+
ref: y,
|
|
923
844
|
"data-virtual-input": "true",
|
|
924
|
-
"data-focused":
|
|
925
|
-
"data-value": M,
|
|
845
|
+
"data-focused": h || void 0,
|
|
926
846
|
style: {
|
|
927
|
-
display: "block",
|
|
928
847
|
position: "relative",
|
|
848
|
+
display: "flex",
|
|
849
|
+
alignItems: "center",
|
|
929
850
|
boxSizing: "border-box",
|
|
930
851
|
minHeight: "2.75em",
|
|
931
852
|
padding: "0.65em 0.8em",
|
|
@@ -933,86 +854,89 @@ const Xe = typeof window > "u" ? K : at, Dt = rt(
|
|
|
933
854
|
borderRadius: 8,
|
|
934
855
|
font: "inherit",
|
|
935
856
|
width: "100%",
|
|
936
|
-
whiteSpace: "pre",
|
|
937
|
-
overflowX: "auto",
|
|
938
|
-
scrollbarWidth: "none",
|
|
939
857
|
cursor: l ? "not-allowed" : "text",
|
|
940
|
-
userSelect: l ? "none" : "text",
|
|
941
|
-
WebkitUserSelect: l ? "none" : "text",
|
|
942
|
-
WebkitTouchCallout: "default",
|
|
943
|
-
touchAction: "manipulation",
|
|
944
858
|
opacity: l ? 0.5 : 1,
|
|
945
|
-
|
|
859
|
+
colorScheme: ue,
|
|
860
|
+
outline: b ? "2px solid currentColor" : void 0,
|
|
861
|
+
outlineOffset: 2,
|
|
946
862
|
...w.style
|
|
947
863
|
},
|
|
948
864
|
onFocus: (t) => {
|
|
949
|
-
w.onFocus?.(t), !t.defaultPrevented && !l && !u &&
|
|
865
|
+
O(!0), w.onFocus?.(t), !t.defaultPrevented && !l && !u && te(H, t.currentTarget, j);
|
|
950
866
|
},
|
|
951
867
|
onBlur: (t) => {
|
|
952
|
-
w.onBlur?.(t),
|
|
868
|
+
O(!1), w.onBlur?.(t), t.defaultPrevented || F(t);
|
|
953
869
|
},
|
|
954
|
-
onKeyDown:
|
|
955
|
-
onCopy: (t) =>
|
|
956
|
-
onCut: (t) =>
|
|
870
|
+
onKeyDown: Ye,
|
|
871
|
+
onCopy: (t) => ze(t, !1),
|
|
872
|
+
onCut: (t) => ze(t, !0),
|
|
957
873
|
onPaste: (t) => {
|
|
958
|
-
w.onPaste?.(t), !t.defaultPrevented && !l && !u && (t.preventDefault(),
|
|
959
|
-
},
|
|
960
|
-
onPointerDown: Qe,
|
|
961
|
-
onDoubleClick: (t) => {
|
|
962
|
-
w.onDoubleClick?.(t), !(t.defaultPrevented || l || t.button !== 0) && (t.preventDefault(), Be(t.clientX));
|
|
963
|
-
},
|
|
964
|
-
onPointerMove: (t) => {
|
|
965
|
-
if (w.onPointerMove?.(t), t.defaultPrevented) {
|
|
966
|
-
z();
|
|
967
|
-
return;
|
|
968
|
-
}
|
|
969
|
-
!R.current || R.current.id !== t.pointerId || Math.hypot(
|
|
970
|
-
t.clientX - R.current.x,
|
|
971
|
-
t.clientY - R.current.y
|
|
972
|
-
) > 8 && (clearTimeout(q.current), R.current.mouse || z());
|
|
973
|
-
},
|
|
974
|
-
onPointerUp: (t) => {
|
|
975
|
-
w.onPointerUp?.(t);
|
|
976
|
-
const o = R.current;
|
|
977
|
-
if (!t.defaultPrevented && o?.id === t.pointerId && !o.held && Math.hypot(t.clientX - o.x, t.clientY - o.y) <= 8) {
|
|
978
|
-
const f = H();
|
|
979
|
-
if (!f || !o.mouse && f.anchor === f.caret) {
|
|
980
|
-
const x = be(t.clientX);
|
|
981
|
-
xe(), S({
|
|
982
|
-
...c.current,
|
|
983
|
-
caret: x,
|
|
984
|
-
anchor: t.shiftKey ? o.anchor : x,
|
|
985
|
-
composing: !1
|
|
986
|
-
});
|
|
987
|
-
}
|
|
988
|
-
}
|
|
989
|
-
z();
|
|
990
|
-
},
|
|
991
|
-
onPointerCancel: (t) => {
|
|
992
|
-
w.onPointerCancel?.(t), z();
|
|
993
|
-
},
|
|
994
|
-
onLostPointerCapture: (t) => {
|
|
995
|
-
w.onLostPointerCapture?.(t), R.current?.id === t.pointerId && z();
|
|
996
|
-
},
|
|
997
|
-
onContextMenu: (t) => {
|
|
998
|
-
w.onContextMenu?.(t), t.defaultPrevented || H();
|
|
874
|
+
w.onPaste?.(t), !t.defaultPrevented && !l && !u && (t.preventDefault(), ce(t.clipboardData.getData("text/plain")));
|
|
999
875
|
},
|
|
1000
876
|
children: [
|
|
1001
|
-
/* @__PURE__ */
|
|
1002
|
-
|
|
1003
|
-
!M && /* @__PURE__ */ L(
|
|
1004
|
-
"span",
|
|
877
|
+
/* @__PURE__ */ T(
|
|
878
|
+
"input",
|
|
1005
879
|
{
|
|
1006
|
-
|
|
880
|
+
..._e,
|
|
881
|
+
ref: A,
|
|
882
|
+
id: w.id ?? H,
|
|
883
|
+
type: "text",
|
|
884
|
+
role: "textbox",
|
|
885
|
+
inputMode: "none",
|
|
886
|
+
autoComplete: "off",
|
|
887
|
+
autoCorrect: "off",
|
|
888
|
+
autoCapitalize: "off",
|
|
889
|
+
spellCheck: w.spellCheck ?? !1,
|
|
890
|
+
tabIndex: l ? -1 : w.tabIndex ?? 0,
|
|
891
|
+
disabled: l,
|
|
892
|
+
readOnly: u,
|
|
893
|
+
"aria-disabled": l || void 0,
|
|
894
|
+
"aria-readonly": u || void 0,
|
|
895
|
+
"data-virtual-input": "true",
|
|
896
|
+
"data-focused": h || void 0,
|
|
897
|
+
"data-value": W,
|
|
898
|
+
placeholder: a,
|
|
899
|
+
value: Y ?? W,
|
|
1007
900
|
style: {
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
901
|
+
position: "absolute",
|
|
902
|
+
inset: 0,
|
|
903
|
+
boxSizing: "border-box",
|
|
904
|
+
display: "block",
|
|
905
|
+
width: "100%",
|
|
906
|
+
height: "100%",
|
|
907
|
+
minWidth: 0,
|
|
908
|
+
minHeight: "1.5em",
|
|
909
|
+
margin: 0,
|
|
910
|
+
padding: "inherit",
|
|
911
|
+
border: 0,
|
|
912
|
+
borderRadius: "inherit",
|
|
913
|
+
outline: "none",
|
|
914
|
+
background: "transparent",
|
|
915
|
+
color: "inherit",
|
|
916
|
+
caretColor: "currentColor",
|
|
917
|
+
font: "inherit",
|
|
918
|
+
lineHeight: "inherit",
|
|
919
|
+
letterSpacing: "inherit",
|
|
920
|
+
textAlign: "inherit",
|
|
921
|
+
appearance: "none",
|
|
922
|
+
WebkitAppearance: "none",
|
|
923
|
+
userSelect: "text",
|
|
924
|
+
WebkitUserSelect: "text",
|
|
925
|
+
touchAction: "manipulation"
|
|
1011
926
|
},
|
|
1012
|
-
|
|
927
|
+
onChange: (t) => {
|
|
928
|
+
B.current ? N(t.currentTarget.value) : Be(t.currentTarget);
|
|
929
|
+
},
|
|
930
|
+
onSelect: D,
|
|
931
|
+
onCompositionStart: () => {
|
|
932
|
+
D(), R.current = d.current, B.current = !0, N(A.current?.value ?? d.current.value);
|
|
933
|
+
},
|
|
934
|
+
onCompositionEnd: (t) => {
|
|
935
|
+
B.current = !1, N(null), R.current?.value === d.current.value ? Be(t.currentTarget) : (t.currentTarget.value = d.current.value, E({ ...d.current })), R.current = null;
|
|
936
|
+
}
|
|
1013
937
|
}
|
|
1014
938
|
),
|
|
1015
|
-
/* @__PURE__ */
|
|
939
|
+
/* @__PURE__ */ T(
|
|
1016
940
|
"span",
|
|
1017
941
|
{
|
|
1018
942
|
role: "status",
|
|
@@ -1022,18 +946,16 @@ const Xe = typeof window > "u" ? K : at, Dt = rt(
|
|
|
1022
946
|
height: 1,
|
|
1023
947
|
overflow: "hidden",
|
|
1024
948
|
clipPath: "inset(50%)",
|
|
1025
|
-
whiteSpace: "nowrap"
|
|
1026
|
-
userSelect: "none",
|
|
1027
|
-
WebkitUserSelect: "none"
|
|
949
|
+
whiteSpace: "nowrap"
|
|
1028
950
|
},
|
|
1029
|
-
children:
|
|
951
|
+
children: ye
|
|
1030
952
|
}
|
|
1031
953
|
)
|
|
1032
954
|
]
|
|
1033
955
|
}
|
|
1034
956
|
);
|
|
1035
957
|
}
|
|
1036
|
-
),
|
|
958
|
+
), gt = [
|
|
1037
959
|
[
|
|
1038
960
|
{
|
|
1039
961
|
value: "1"
|
|
@@ -1150,55 +1072,55 @@ const Xe = typeof window > "u" ? K : at, Dt = rt(
|
|
|
1150
1072
|
}
|
|
1151
1073
|
]
|
|
1152
1074
|
];
|
|
1153
|
-
function
|
|
1075
|
+
function vt({
|
|
1154
1076
|
tagName: e,
|
|
1155
1077
|
css: n,
|
|
1156
1078
|
children: r,
|
|
1157
1079
|
hostRef: a,
|
|
1158
1080
|
...i
|
|
1159
1081
|
}) {
|
|
1160
|
-
const [s,
|
|
1161
|
-
(
|
|
1162
|
-
a && (a.current =
|
|
1082
|
+
const [s, f] = P(null), v = S(
|
|
1083
|
+
(c) => {
|
|
1084
|
+
a && (a.current = c), c && f(c.shadowRoot ?? c.attachShadow({ mode: "open" }));
|
|
1163
1085
|
},
|
|
1164
1086
|
[a]
|
|
1165
1087
|
);
|
|
1166
|
-
return
|
|
1088
|
+
return at(
|
|
1167
1089
|
e,
|
|
1168
1090
|
{ ...i, ref: v },
|
|
1169
|
-
s &&
|
|
1170
|
-
/* @__PURE__ */
|
|
1171
|
-
n && /* @__PURE__ */
|
|
1091
|
+
s && Te(
|
|
1092
|
+
/* @__PURE__ */ q(Me, { children: [
|
|
1093
|
+
n && /* @__PURE__ */ T("style", { children: n }),
|
|
1172
1094
|
r
|
|
1173
1095
|
] }),
|
|
1174
1096
|
s
|
|
1175
1097
|
)
|
|
1176
1098
|
);
|
|
1177
1099
|
}
|
|
1178
|
-
function
|
|
1100
|
+
function je(e, n, r) {
|
|
1179
1101
|
if (e.type === "action") return e.value === `
|
|
1180
1102
|
` ? "Enter" : e.value;
|
|
1181
1103
|
if (!/^[a-zA-Z]$/.test(e.value)) return e.value;
|
|
1182
1104
|
const a = r ? e.value.toUpperCase() : e.value;
|
|
1183
|
-
return n ?
|
|
1105
|
+
return n ? Ue(a) : a;
|
|
1184
1106
|
}
|
|
1185
|
-
function
|
|
1186
|
-
const a =
|
|
1107
|
+
function Ae(e, { disabled: n = !1, repeat: r = !1 } = {}) {
|
|
1108
|
+
const a = I(e);
|
|
1187
1109
|
a.current = e;
|
|
1188
|
-
const i =
|
|
1110
|
+
const i = I(void 0), s = I(null), [f, v] = P(!1), c = S(() => {
|
|
1189
1111
|
clearTimeout(i.current), s.current = null, v(!1);
|
|
1190
1112
|
}, []);
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
}), [
|
|
1194
|
-
n &&
|
|
1195
|
-
}, [n,
|
|
1196
|
-
const
|
|
1113
|
+
z(() => (window.addEventListener("blur", c), document.addEventListener("visibilitychange", c), () => {
|
|
1114
|
+
c(), window.removeEventListener("blur", c), document.removeEventListener("visibilitychange", c);
|
|
1115
|
+
}), [c]), z(() => {
|
|
1116
|
+
n && c();
|
|
1117
|
+
}, [n, c]);
|
|
1118
|
+
const m = (p) => {
|
|
1197
1119
|
const l = s.current?.bounds;
|
|
1198
1120
|
return !!l && p.clientX >= l.left && p.clientX <= l.right && p.clientY >= l.top && p.clientY <= l.bottom;
|
|
1199
1121
|
};
|
|
1200
1122
|
return {
|
|
1201
|
-
"data-pressed":
|
|
1123
|
+
"data-pressed": f || void 0,
|
|
1202
1124
|
onPointerDown: (p) => {
|
|
1203
1125
|
if (!(n || p.button !== 0 || s.current)) {
|
|
1204
1126
|
p.preventDefault(), s.current = {
|
|
@@ -1219,28 +1141,28 @@ function Me(e, { disabled: n = !1, repeat: r = !1 } = {}) {
|
|
|
1219
1141
|
}
|
|
1220
1142
|
},
|
|
1221
1143
|
onPointerMove: (p) => {
|
|
1222
|
-
s.current?.id === p.pointerId && !
|
|
1144
|
+
s.current?.id === p.pointerId && !m(p) && c();
|
|
1223
1145
|
},
|
|
1224
1146
|
onPointerUp: (p) => {
|
|
1225
1147
|
if (s.current?.id !== p.pointerId) return;
|
|
1226
|
-
const l = !n &&
|
|
1227
|
-
|
|
1148
|
+
const l = !n && m(p) && !s.current.repeated;
|
|
1149
|
+
c(), l && a.current();
|
|
1228
1150
|
},
|
|
1229
1151
|
onPointerCancel: (p) => {
|
|
1230
|
-
s.current?.id === p.pointerId &&
|
|
1152
|
+
s.current?.id === p.pointerId && c();
|
|
1231
1153
|
},
|
|
1232
1154
|
onLostPointerCapture: (p) => {
|
|
1233
|
-
s.current?.id === p.pointerId &&
|
|
1155
|
+
s.current?.id === p.pointerId && c();
|
|
1234
1156
|
},
|
|
1235
1157
|
onPointerLeave: (p) => {
|
|
1236
|
-
s.current?.id === p.pointerId && !
|
|
1158
|
+
s.current?.id === p.pointerId && !m(p) && c();
|
|
1237
1159
|
},
|
|
1238
1160
|
onClick: (p) => {
|
|
1239
1161
|
!n && p.detail === 0 && !s.current && a.current();
|
|
1240
1162
|
}
|
|
1241
1163
|
};
|
|
1242
1164
|
}
|
|
1243
|
-
const
|
|
1165
|
+
const Ce = {
|
|
1244
1166
|
Shift: "Shift",
|
|
1245
1167
|
HangulMode: "한영 전환",
|
|
1246
1168
|
Backspace: "지우기",
|
|
@@ -1259,7 +1181,7 @@ const Te = {
|
|
|
1259
1181
|
Redo: "다시 실행",
|
|
1260
1182
|
SelectAll: "전체 선택"
|
|
1261
1183
|
};
|
|
1262
|
-
function
|
|
1184
|
+
function Ne({
|
|
1263
1185
|
cell: e,
|
|
1264
1186
|
label: n,
|
|
1265
1187
|
value: r,
|
|
@@ -1267,22 +1189,22 @@ function We({
|
|
|
1267
1189
|
disabled: i,
|
|
1268
1190
|
dispatch: s
|
|
1269
1191
|
}) {
|
|
1270
|
-
const
|
|
1192
|
+
const f = Ae(s, {
|
|
1271
1193
|
disabled: i,
|
|
1272
1194
|
repeat: ["Backspace", "Delete", "ArrowLeft", "ArrowRight"].includes(r)
|
|
1273
|
-
}), v = e.type === "action" && r === "HangulMode",
|
|
1274
|
-
return /* @__PURE__ */
|
|
1195
|
+
}), v = e.type === "action" && r === "HangulMode", c = e.type === "action" && (r === "Backspace" && (!e.label || e.label === "⌫") || r === "Delete" && (!e.label || e.label === "⌦"));
|
|
1196
|
+
return /* @__PURE__ */ T(
|
|
1275
1197
|
"button",
|
|
1276
1198
|
{
|
|
1277
1199
|
type: "button",
|
|
1278
1200
|
disabled: i,
|
|
1279
|
-
"aria-label":
|
|
1201
|
+
"aria-label": Ce[r] ?? n,
|
|
1280
1202
|
"aria-pressed": a,
|
|
1281
1203
|
className: v ? "key action language" : e.type === "action" ? "key action" : "key",
|
|
1282
1204
|
title: v ? i ? `${a ? "한국어" : "영어"} 전용` : `${a ? "영어" : "한국어"}로 전환` : void 0,
|
|
1283
1205
|
style: { flex: e.width && e.width > 0 ? e.width : 1 },
|
|
1284
|
-
...
|
|
1285
|
-
children:
|
|
1206
|
+
...f,
|
|
1207
|
+
children: c ? /* @__PURE__ */ q(
|
|
1286
1208
|
"svg",
|
|
1287
1209
|
{
|
|
1288
1210
|
"data-key-icon": r === "Backspace" ? "backspace" : "delete",
|
|
@@ -1298,12 +1220,12 @@ function We({
|
|
|
1298
1220
|
focusable: "false",
|
|
1299
1221
|
style: r === "Delete" ? { transform: "scaleX(-1)" } : void 0,
|
|
1300
1222
|
children: [
|
|
1301
|
-
/* @__PURE__ */
|
|
1302
|
-
/* @__PURE__ */
|
|
1223
|
+
/* @__PURE__ */ T("path", { d: "M9 5H20a1.5 1.5 0 0 1 1.5 1.5v11A1.5 1.5 0 0 1 20 19H9l-7-7 7-7Z" }),
|
|
1224
|
+
/* @__PURE__ */ T("path", { d: "m12 9 6 6m0-6-6 6" })
|
|
1303
1225
|
]
|
|
1304
1226
|
}
|
|
1305
|
-
) : v && !e.label ? /* @__PURE__ */
|
|
1306
|
-
/* @__PURE__ */
|
|
1227
|
+
) : v && !e.label ? /* @__PURE__ */ q("span", { className: "language-label", "aria-hidden": "true", children: [
|
|
1228
|
+
/* @__PURE__ */ q(
|
|
1307
1229
|
"svg",
|
|
1308
1230
|
{
|
|
1309
1231
|
width: "19",
|
|
@@ -1316,73 +1238,73 @@ function We({
|
|
|
1316
1238
|
strokeLinejoin: "round",
|
|
1317
1239
|
focusable: "false",
|
|
1318
1240
|
children: [
|
|
1319
|
-
/* @__PURE__ */
|
|
1320
|
-
/* @__PURE__ */
|
|
1321
|
-
/* @__PURE__ */
|
|
1241
|
+
/* @__PURE__ */ T("circle", { cx: "12", cy: "12", r: "9" }),
|
|
1242
|
+
/* @__PURE__ */ T("ellipse", { cx: "12", cy: "12", rx: "4", ry: "9" }),
|
|
1243
|
+
/* @__PURE__ */ T("path", { d: "M3 12h18" })
|
|
1322
1244
|
]
|
|
1323
1245
|
}
|
|
1324
1246
|
),
|
|
1325
|
-
/* @__PURE__ */
|
|
1247
|
+
/* @__PURE__ */ T("span", { children: a ? "한" : "EN" })
|
|
1326
1248
|
] }) : n
|
|
1327
1249
|
}
|
|
1328
1250
|
);
|
|
1329
1251
|
}
|
|
1330
|
-
function
|
|
1252
|
+
function mt({
|
|
1331
1253
|
layout: e,
|
|
1332
1254
|
viewport: n,
|
|
1333
1255
|
onHeightChange: r
|
|
1334
1256
|
}) {
|
|
1335
|
-
const a =
|
|
1257
|
+
const a = Ze(), {
|
|
1336
1258
|
inputRef: i,
|
|
1337
1259
|
hangulMode: s,
|
|
1338
|
-
shift:
|
|
1260
|
+
shift: f,
|
|
1339
1261
|
shiftLocked: v,
|
|
1340
|
-
theme:
|
|
1341
|
-
selectionMode:
|
|
1262
|
+
theme: c,
|
|
1263
|
+
selectionMode: m,
|
|
1342
1264
|
selectionAdjusting: p,
|
|
1343
1265
|
activeInputPolicy: l,
|
|
1344
1266
|
editingStatus: u,
|
|
1345
|
-
onBlur:
|
|
1346
|
-
} = a, w =
|
|
1267
|
+
onBlur: V
|
|
1268
|
+
} = a, w = I(null), [Q, H] = P(!1), le = Ae(() => H((g) => !g)), te = Ae(() => V(!0)), F = ["text", "hangul", "custom"].includes(
|
|
1347
1269
|
l.mode
|
|
1348
|
-
),
|
|
1349
|
-
|
|
1270
|
+
), oe = Q && F && !m ? gt : e;
|
|
1271
|
+
z(() => {
|
|
1350
1272
|
if (!w.current) return;
|
|
1351
|
-
const
|
|
1352
|
-
const
|
|
1353
|
-
r(
|
|
1273
|
+
const g = () => {
|
|
1274
|
+
const y = w.current?.getBoundingClientRect().height ?? 0;
|
|
1275
|
+
r(y);
|
|
1354
1276
|
};
|
|
1355
|
-
|
|
1356
|
-
const
|
|
1357
|
-
return
|
|
1358
|
-
}, [r]),
|
|
1359
|
-
let
|
|
1360
|
-
const
|
|
1361
|
-
(
|
|
1362
|
-
), A = (
|
|
1363
|
-
|
|
1364
|
-
},
|
|
1365
|
-
|
|
1366
|
-
},
|
|
1367
|
-
|
|
1368
|
-
},
|
|
1369
|
-
|
|
1370
|
-
},
|
|
1371
|
-
|
|
1372
|
-
},
|
|
1373
|
-
|
|
1277
|
+
g();
|
|
1278
|
+
const L = new ResizeObserver(g);
|
|
1279
|
+
return L.observe(w.current), () => L.disconnect();
|
|
1280
|
+
}, [r]), z(() => {
|
|
1281
|
+
let g = null;
|
|
1282
|
+
const L = /* @__PURE__ */ new Set(), y = (b) => b.composedPath().some(
|
|
1283
|
+
(O) => O === w.current || O instanceof Element && O.hasAttribute("data-virtual-input")
|
|
1284
|
+
), A = (b) => {
|
|
1285
|
+
L.add(b.pointerId), g = L.size !== 1 || b.button !== 0 || y(b) ? null : { x: b.clientX, y: b.clientY, id: b.pointerId };
|
|
1286
|
+
}, x = (b) => {
|
|
1287
|
+
g && g.id === b.pointerId && Math.hypot(b.clientX - g.x, b.clientY - g.y) < 10 && !y(b) && V(!0), g = null, L.delete(b.pointerId);
|
|
1288
|
+
}, B = (b) => {
|
|
1289
|
+
g?.id === b.pointerId && Math.hypot(b.clientX - g.x, b.clientY - g.y) >= 10 && (g = null);
|
|
1290
|
+
}, R = () => {
|
|
1291
|
+
g = null;
|
|
1292
|
+
}, Y = (b) => {
|
|
1293
|
+
R(), L.delete(b.pointerId);
|
|
1294
|
+
}, N = () => {
|
|
1295
|
+
R(), L.clear();
|
|
1374
1296
|
};
|
|
1375
|
-
return window.addEventListener("pointerdown", A, !0), window.addEventListener("pointermove",
|
|
1376
|
-
window.removeEventListener("pointerdown", A, !0), window.removeEventListener("pointermove",
|
|
1297
|
+
return window.addEventListener("pointerdown", A, !0), window.addEventListener("pointermove", B, !0), window.addEventListener("pointerup", x, !0), window.addEventListener("pointercancel", Y, !0), window.addEventListener("scroll", R, !0), window.addEventListener("blur", N), document.addEventListener("visibilitychange", N), () => {
|
|
1298
|
+
window.removeEventListener("pointerdown", A, !0), window.removeEventListener("pointermove", B, !0), window.removeEventListener("pointerup", x, !0), window.removeEventListener("pointercancel", Y, !0), window.removeEventListener("scroll", R, !0), window.removeEventListener("blur", N), document.removeEventListener("visibilitychange", N);
|
|
1377
1299
|
};
|
|
1378
|
-
}, [
|
|
1379
|
-
const X = (
|
|
1380
|
-
const
|
|
1381
|
-
if (
|
|
1382
|
-
i.current?.insertText(
|
|
1300
|
+
}, [V]);
|
|
1301
|
+
const X = (g) => {
|
|
1302
|
+
const L = je(g, s, f);
|
|
1303
|
+
if (g.type !== "action") {
|
|
1304
|
+
i.current?.insertText(L, we(L)), a.consumeShift();
|
|
1383
1305
|
return;
|
|
1384
1306
|
}
|
|
1385
|
-
switch (
|
|
1307
|
+
switch (L) {
|
|
1386
1308
|
case "Undo":
|
|
1387
1309
|
i.current?.undo();
|
|
1388
1310
|
break;
|
|
@@ -1397,11 +1319,11 @@ function xt({
|
|
|
1397
1319
|
break;
|
|
1398
1320
|
case "HangulMode":
|
|
1399
1321
|
i.current?.handleKeyDown(
|
|
1400
|
-
new KeyboardEvent("keydown", { key:
|
|
1322
|
+
new KeyboardEvent("keydown", { key: L })
|
|
1401
1323
|
);
|
|
1402
1324
|
break;
|
|
1403
1325
|
case "EnterSelectionMode":
|
|
1404
|
-
|
|
1326
|
+
H(!1), a.enterSelectionMode();
|
|
1405
1327
|
break;
|
|
1406
1328
|
case "ExitSelectionMode":
|
|
1407
1329
|
a.exitSelectionMode();
|
|
@@ -1425,11 +1347,11 @@ function xt({
|
|
|
1425
1347
|
i.current?.moveCaret("right", p);
|
|
1426
1348
|
break;
|
|
1427
1349
|
default:
|
|
1428
|
-
|
|
1429
|
-
new KeyboardEvent("keydown", { key:
|
|
1350
|
+
L === " " ? i.current?.insertText(" ") : i.current?.handleKeyDown(
|
|
1351
|
+
new KeyboardEvent("keydown", { key: L })
|
|
1430
1352
|
);
|
|
1431
1353
|
}
|
|
1432
|
-
},
|
|
1354
|
+
}, J = me(l.mode) !== null, ue = {
|
|
1433
1355
|
position: "fixed",
|
|
1434
1356
|
zIndex: 9999,
|
|
1435
1357
|
boxSizing: "border-box",
|
|
@@ -1440,33 +1362,33 @@ function xt({
|
|
|
1440
1362
|
...n.height ? { top: n.offsetTop + n.height } : { bottom: 0 },
|
|
1441
1363
|
maxHeight: n.height ? n.height * 0.65 : "65dvh",
|
|
1442
1364
|
overflowY: "auto",
|
|
1443
|
-
colorScheme:
|
|
1444
|
-
background:
|
|
1445
|
-
color:
|
|
1446
|
-
border: "1px solid " + (
|
|
1365
|
+
colorScheme: c,
|
|
1366
|
+
background: c === "dark" ? "#18201f" : "#e9eeeb",
|
|
1367
|
+
color: c === "dark" ? "#eef4ef" : "#203b31",
|
|
1368
|
+
border: "1px solid " + (c === "dark" ? "#35413c" : "#c8d3cb"),
|
|
1447
1369
|
borderRadius: "20px 20px 0 0",
|
|
1448
1370
|
boxShadow: "0 -8px 48px #10251a20",
|
|
1449
1371
|
touchAction: "manipulation",
|
|
1450
1372
|
userSelect: "none",
|
|
1451
1373
|
WebkitUserSelect: "none"
|
|
1452
1374
|
};
|
|
1453
|
-
return
|
|
1454
|
-
/* @__PURE__ */
|
|
1455
|
-
|
|
1375
|
+
return Te(
|
|
1376
|
+
/* @__PURE__ */ T(
|
|
1377
|
+
vt,
|
|
1456
1378
|
{
|
|
1457
1379
|
tagName: "virtual-keypad",
|
|
1458
1380
|
hostRef: w,
|
|
1459
1381
|
"data-virtual-keypad": "true",
|
|
1460
|
-
style:
|
|
1461
|
-
onPointerDown: (
|
|
1462
|
-
|
|
1382
|
+
style: ue,
|
|
1383
|
+
onPointerDown: (g) => {
|
|
1384
|
+
g.button === 0 && g.preventDefault();
|
|
1463
1385
|
},
|
|
1464
|
-
onMouseDown: (
|
|
1465
|
-
|
|
1386
|
+
onMouseDown: (g) => {
|
|
1387
|
+
g.button === 0 && g.preventDefault();
|
|
1466
1388
|
},
|
|
1467
1389
|
onBlur: a.onBlur,
|
|
1468
|
-
onKeyDown: (
|
|
1469
|
-
|
|
1390
|
+
onKeyDown: (g) => {
|
|
1391
|
+
g.key === "Escape" && (g.preventDefault(), V(!0));
|
|
1470
1392
|
},
|
|
1471
1393
|
css: `
|
|
1472
1394
|
* {
|
|
@@ -1514,9 +1436,9 @@ function xt({
|
|
|
1514
1436
|
min-height: 44px;
|
|
1515
1437
|
border: 0;
|
|
1516
1438
|
border-radius: 8px;
|
|
1517
|
-
background: ${
|
|
1439
|
+
background: ${c === "dark" ? "#303c37" : "#fff"};
|
|
1518
1440
|
color: inherit;
|
|
1519
|
-
box-shadow: 0 2px 0 ${
|
|
1441
|
+
box-shadow: 0 2px 0 ${c === "dark" ? "#0d1611" : "#bdc9c1"};
|
|
1520
1442
|
font: inherit;
|
|
1521
1443
|
padding: 8px 0;
|
|
1522
1444
|
touch-action: none;
|
|
@@ -1524,7 +1446,7 @@ function xt({
|
|
|
1524
1446
|
user-select: none;
|
|
1525
1447
|
}
|
|
1526
1448
|
.action {
|
|
1527
|
-
background: ${
|
|
1449
|
+
background: ${c === "dark" ? "#414e46" : "#d7e1db"};
|
|
1528
1450
|
font-size: 14px;
|
|
1529
1451
|
}
|
|
1530
1452
|
.selection-count {
|
|
@@ -1596,10 +1518,10 @@ function xt({
|
|
|
1596
1518
|
}
|
|
1597
1519
|
}
|
|
1598
1520
|
`,
|
|
1599
|
-
children: /* @__PURE__ */
|
|
1600
|
-
/* @__PURE__ */
|
|
1601
|
-
u.selectionLength > 0 && !
|
|
1602
|
-
/* @__PURE__ */
|
|
1521
|
+
children: /* @__PURE__ */ q("section", { className: "keyboard", role: "group", "aria-label": "가상 키보드", children: [
|
|
1522
|
+
/* @__PURE__ */ q("div", { className: "toolbar", children: [
|
|
1523
|
+
u.selectionLength > 0 && !m ? /* @__PURE__ */ q(Me, { children: [
|
|
1524
|
+
/* @__PURE__ */ T(
|
|
1603
1525
|
"span",
|
|
1604
1526
|
{
|
|
1605
1527
|
className: "selection-count",
|
|
@@ -1607,91 +1529,91 @@ function xt({
|
|
|
1607
1529
|
children: u.message === "복사했어요" ? "복사했어요" : `${u.selectionLength}자 선택`
|
|
1608
1530
|
}
|
|
1609
1531
|
),
|
|
1610
|
-
/* @__PURE__ */
|
|
1532
|
+
/* @__PURE__ */ T(
|
|
1611
1533
|
"div",
|
|
1612
1534
|
{
|
|
1613
1535
|
className: "selection-actions",
|
|
1614
1536
|
role: "group",
|
|
1615
1537
|
"aria-label": "선택한 텍스트 편집",
|
|
1616
|
-
children: ["Copy", "Cut", "SelectAll"].map((
|
|
1617
|
-
|
|
1538
|
+
children: ["Copy", "Cut", "SelectAll"].map((g) => /* @__PURE__ */ T(
|
|
1539
|
+
Ne,
|
|
1618
1540
|
{
|
|
1619
|
-
cell: { value:
|
|
1620
|
-
value:
|
|
1621
|
-
label:
|
|
1622
|
-
dispatch: () => X({ value:
|
|
1541
|
+
cell: { value: g, type: "action" },
|
|
1542
|
+
value: g,
|
|
1543
|
+
label: Ce[g],
|
|
1544
|
+
dispatch: () => X({ value: g, type: "action" })
|
|
1623
1545
|
},
|
|
1624
|
-
|
|
1546
|
+
g
|
|
1625
1547
|
))
|
|
1626
1548
|
}
|
|
1627
1549
|
)
|
|
1628
|
-
] }) : /* @__PURE__ */
|
|
1629
|
-
|
|
1550
|
+
] }) : /* @__PURE__ */ q("span", { children: [
|
|
1551
|
+
m ? u.message === "복사했어요" ? "복사했어요" : "텍스트 편집" : Q && F ? "숫자 · 기호" : l.mode === "number" ? "숫자" : l.mode === "tel" ? "전화번호" : s ? "한국어 · 두벌식" : "English",
|
|
1630
1552
|
v ? " · Shift 고정" : ""
|
|
1631
1553
|
] }),
|
|
1632
|
-
F && !
|
|
1554
|
+
F && !m && !u.selectionLength && /* @__PURE__ */ T(
|
|
1633
1555
|
"button",
|
|
1634
1556
|
{
|
|
1635
1557
|
type: "button",
|
|
1636
1558
|
className: "close",
|
|
1637
1559
|
"aria-label": "숫자·기호 전환",
|
|
1638
|
-
"aria-pressed":
|
|
1639
|
-
...
|
|
1640
|
-
children:
|
|
1560
|
+
"aria-pressed": Q,
|
|
1561
|
+
...le,
|
|
1562
|
+
children: Q ? "가 / ABC" : "123 / #+="
|
|
1641
1563
|
}
|
|
1642
1564
|
),
|
|
1643
|
-
/* @__PURE__ */
|
|
1565
|
+
/* @__PURE__ */ T(
|
|
1644
1566
|
"button",
|
|
1645
1567
|
{
|
|
1646
1568
|
type: "button",
|
|
1647
1569
|
className: "close",
|
|
1648
|
-
...
|
|
1570
|
+
...te,
|
|
1649
1571
|
"aria-label": "키보드 닫기",
|
|
1650
1572
|
children: "닫기 ↓"
|
|
1651
1573
|
}
|
|
1652
1574
|
)
|
|
1653
1575
|
] }),
|
|
1654
|
-
u.message && u.message !== "복사했어요" && /* @__PURE__ */
|
|
1655
|
-
|
|
1656
|
-
const
|
|
1657
|
-
return /* @__PURE__ */
|
|
1658
|
-
|
|
1576
|
+
u.message && u.message !== "복사했어요" && /* @__PURE__ */ T("p", { className: "feedback", children: u.message }),
|
|
1577
|
+
oe.map((g, L) => /* @__PURE__ */ T("div", { className: "row", children: g.map((y, A) => {
|
|
1578
|
+
const x = je(y, s, f), B = y.type === "action" ? y.label ?? Ce[x] ?? x : /^[A-Za-z]$/.test(y.value) ? x : y.label ?? x, R = y.value === "Shift" ? f : y.value === "HangulMode" ? s : y.value === "ToggleSelectionAdjust" ? p : void 0;
|
|
1579
|
+
return /* @__PURE__ */ T(
|
|
1580
|
+
Ne,
|
|
1659
1581
|
{
|
|
1660
|
-
cell:
|
|
1661
|
-
label:
|
|
1662
|
-
value:
|
|
1663
|
-
active:
|
|
1664
|
-
disabled:
|
|
1665
|
-
dispatch: () => X(
|
|
1582
|
+
cell: y,
|
|
1583
|
+
label: B,
|
|
1584
|
+
value: x,
|
|
1585
|
+
active: R,
|
|
1586
|
+
disabled: y.value === "HangulMode" && J || ["Copy", "Cut"].includes(x) && !u.selectionLength || x === "SelectAll" && !u.hasValue || (y.type !== "action" || x === " ") && !l.filterKey(x),
|
|
1587
|
+
dispatch: () => X(y)
|
|
1666
1588
|
},
|
|
1667
|
-
`${
|
|
1589
|
+
`${L}-${A}-${y.value}`
|
|
1668
1590
|
);
|
|
1669
|
-
}) },
|
|
1591
|
+
}) }, L))
|
|
1670
1592
|
] })
|
|
1671
1593
|
}
|
|
1672
1594
|
),
|
|
1673
1595
|
document.body
|
|
1674
1596
|
);
|
|
1675
1597
|
}
|
|
1676
|
-
const
|
|
1677
|
-
function
|
|
1678
|
-
const r =
|
|
1598
|
+
const ke = "virtual-keyboard:storage";
|
|
1599
|
+
function wt(e, n) {
|
|
1600
|
+
const r = I(n), [a, i] = P(n), s = I(a), f = S(
|
|
1679
1601
|
() => r.current instanceof Function ? r.current() : r.current,
|
|
1680
1602
|
[]
|
|
1681
1603
|
);
|
|
1682
|
-
|
|
1683
|
-
const
|
|
1604
|
+
z(() => {
|
|
1605
|
+
const c = (u) => {
|
|
1684
1606
|
try {
|
|
1685
|
-
const
|
|
1686
|
-
return typeof
|
|
1607
|
+
const V = u === null ? f() : JSON.parse(u);
|
|
1608
|
+
return typeof V == typeof f() ? V : f();
|
|
1687
1609
|
} catch {
|
|
1688
|
-
return
|
|
1610
|
+
return f();
|
|
1689
1611
|
}
|
|
1690
|
-
},
|
|
1691
|
-
s.current =
|
|
1612
|
+
}, m = (u) => {
|
|
1613
|
+
s.current = c(u), i(s.current);
|
|
1692
1614
|
};
|
|
1693
1615
|
try {
|
|
1694
|
-
|
|
1616
|
+
m(window.localStorage.getItem(e));
|
|
1695
1617
|
} catch {
|
|
1696
1618
|
}
|
|
1697
1619
|
const p = (u) => {
|
|
@@ -1701,19 +1623,19 @@ function kt(e, n) {
|
|
|
1701
1623
|
} catch {
|
|
1702
1624
|
return;
|
|
1703
1625
|
}
|
|
1704
|
-
(u.key === e || u.key === null) &&
|
|
1626
|
+
(u.key === e || u.key === null) && m(u.newValue);
|
|
1705
1627
|
}, l = (u) => {
|
|
1706
|
-
const
|
|
1707
|
-
|
|
1628
|
+
const V = u.detail;
|
|
1629
|
+
V.key === e && m(V.raw);
|
|
1708
1630
|
};
|
|
1709
|
-
return window.addEventListener("storage", p), window.addEventListener(
|
|
1710
|
-
window.removeEventListener("storage", p), window.removeEventListener(
|
|
1631
|
+
return window.addEventListener("storage", p), window.addEventListener(ke, l), () => {
|
|
1632
|
+
window.removeEventListener("storage", p), window.removeEventListener(ke, l);
|
|
1711
1633
|
};
|
|
1712
|
-
}, [e,
|
|
1713
|
-
const v =
|
|
1714
|
-
(
|
|
1715
|
-
s.current =
|
|
1716
|
-
new CustomEvent(
|
|
1634
|
+
}, [e, f]);
|
|
1635
|
+
const v = S(
|
|
1636
|
+
(c) => {
|
|
1637
|
+
s.current = c instanceof Function ? c(s.current) : c, i(s.current), window.dispatchEvent(
|
|
1638
|
+
new CustomEvent(ke, {
|
|
1717
1639
|
detail: { key: e, raw: JSON.stringify(s.current) }
|
|
1718
1640
|
})
|
|
1719
1641
|
);
|
|
@@ -1726,7 +1648,7 @@ function kt(e, n) {
|
|
|
1726
1648
|
);
|
|
1727
1649
|
return [a, v];
|
|
1728
1650
|
}
|
|
1729
|
-
const
|
|
1651
|
+
const yt = [
|
|
1730
1652
|
[
|
|
1731
1653
|
{
|
|
1732
1654
|
label: "전체 선택",
|
|
@@ -1806,7 +1728,7 @@ const St = [
|
|
|
1806
1728
|
type: "action"
|
|
1807
1729
|
}
|
|
1808
1730
|
]
|
|
1809
|
-
],
|
|
1731
|
+
], bt = () => typeof window > "u" ? { width: 0, height: 0, scale: 1, offsetLeft: 0, offsetTop: 0 } : typeof window < "u" && window.visualViewport ? {
|
|
1810
1732
|
width: window.visualViewport.width,
|
|
1811
1733
|
height: window.visualViewport.height,
|
|
1812
1734
|
scale: window.visualViewport.scale,
|
|
@@ -1818,21 +1740,21 @@ const St = [
|
|
|
1818
1740
|
scale: 1,
|
|
1819
1741
|
offsetLeft: 0,
|
|
1820
1742
|
offsetTop: 0
|
|
1821
|
-
},
|
|
1822
|
-
const [e, n] =
|
|
1743
|
+
}, xt = (e, n) => e.width === n.width && e.height === n.height && e.scale === n.scale && e.offsetLeft === n.offsetLeft && e.offsetTop === n.offsetTop, kt = () => {
|
|
1744
|
+
const [e, n] = P(() => ({
|
|
1823
1745
|
width: 0,
|
|
1824
1746
|
height: 0,
|
|
1825
1747
|
scale: 1,
|
|
1826
1748
|
offsetLeft: 0,
|
|
1827
1749
|
offsetTop: 0
|
|
1828
1750
|
}));
|
|
1829
|
-
return
|
|
1751
|
+
return z(() => {
|
|
1830
1752
|
if (typeof window > "u") return;
|
|
1831
1753
|
let r = null;
|
|
1832
1754
|
const a = () => {
|
|
1833
|
-
const s =
|
|
1755
|
+
const s = bt();
|
|
1834
1756
|
n(
|
|
1835
|
-
(
|
|
1757
|
+
(f) => xt(f, s) ? f : s
|
|
1836
1758
|
);
|
|
1837
1759
|
};
|
|
1838
1760
|
a();
|
|
@@ -1848,9 +1770,9 @@ const St = [
|
|
|
1848
1770
|
};
|
|
1849
1771
|
}, []), e;
|
|
1850
1772
|
};
|
|
1851
|
-
function
|
|
1852
|
-
const [e, n] =
|
|
1853
|
-
return
|
|
1773
|
+
function Et() {
|
|
1774
|
+
const [e, n] = P("light");
|
|
1775
|
+
return z(() => {
|
|
1854
1776
|
if (typeof window > "u" || !window.matchMedia) return;
|
|
1855
1777
|
const r = window.matchMedia("(prefers-color-scheme: dark)");
|
|
1856
1778
|
n(r.matches ? "dark" : "light");
|
|
@@ -1860,149 +1782,154 @@ function At() {
|
|
|
1860
1782
|
return r.addEventListener("change", a), () => r.removeEventListener("change", a);
|
|
1861
1783
|
}, []), e;
|
|
1862
1784
|
}
|
|
1863
|
-
function
|
|
1785
|
+
function Xe(e) {
|
|
1864
1786
|
return e !== void 0 ? /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
|
|
1865
1787
|
e
|
|
1866
|
-
) : typeof navigator > "u" ? !1 :
|
|
1788
|
+
) : typeof navigator > "u" ? !1 : Xe(navigator.userAgent) || navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1 || typeof window < "u" && !!window.matchMedia?.("(pointer: coarse)").matches;
|
|
1867
1789
|
}
|
|
1868
1790
|
const Ee = "virtual-keyboard:focus-change";
|
|
1869
|
-
function
|
|
1791
|
+
function Tt({
|
|
1870
1792
|
children: e,
|
|
1871
|
-
layout: n =
|
|
1793
|
+
layout: n = re,
|
|
1872
1794
|
defaultHangulMode: r = !0,
|
|
1873
1795
|
theme: a,
|
|
1874
1796
|
keyboardVisibility: i = "auto"
|
|
1875
1797
|
}) {
|
|
1876
|
-
const s =
|
|
1798
|
+
const s = $e(), f = I(null), v = I(null), c = I(
|
|
1877
1799
|
void 0
|
|
1878
|
-
), [
|
|
1800
|
+
), [m, p] = P(), [l, u] = P(0), [V, w] = P(!1), [Q, H] = P(!1), [le, te] = P({
|
|
1879
1801
|
selectionLength: 0,
|
|
1880
1802
|
hasValue: !1,
|
|
1881
1803
|
message: ""
|
|
1882
|
-
}),
|
|
1804
|
+
}), F = S((h) => {
|
|
1805
|
+
te(
|
|
1806
|
+
(k) => k.selectionLength === h.selectionLength && k.hasValue === h.hasValue && k.message === h.message ? k : h
|
|
1807
|
+
);
|
|
1808
|
+
}, []), [oe, X] = wt(
|
|
1883
1809
|
"virtual-keyboard-hangul-mode",
|
|
1884
1810
|
r
|
|
1885
|
-
), [
|
|
1886
|
-
() =>
|
|
1887
|
-
), [
|
|
1888
|
-
|
|
1889
|
-
const
|
|
1890
|
-
|
|
1891
|
-
const
|
|
1892
|
-
return
|
|
1811
|
+
), [J, ue] = P(
|
|
1812
|
+
() => Se({ layout: n })
|
|
1813
|
+
), [g, L] = P(!1), [y, A] = P(0), x = kt(), B = Et(), R = me(J.mode) ?? oe, Y = !!m && (i === "always" || i === "auto" && g), N = I(Y);
|
|
1814
|
+
N.current = Y, z(() => {
|
|
1815
|
+
const h = () => L(Xe());
|
|
1816
|
+
h();
|
|
1817
|
+
const k = window.matchMedia?.("(pointer: coarse)");
|
|
1818
|
+
return k?.addEventListener("change", h), () => k?.removeEventListener("change", h);
|
|
1893
1819
|
}, []);
|
|
1894
|
-
const
|
|
1895
|
-
clearTimeout(
|
|
1820
|
+
const b = S(() => {
|
|
1821
|
+
clearTimeout(c.current), v.current = null, f.current = null, p(void 0), u(0), w(!1), H(!1);
|
|
1896
1822
|
}, []);
|
|
1897
|
-
|
|
1898
|
-
const
|
|
1899
|
-
|
|
1823
|
+
z(() => {
|
|
1824
|
+
const h = (k) => {
|
|
1825
|
+
k.detail !== s && b();
|
|
1900
1826
|
};
|
|
1901
|
-
return window.addEventListener(Ee,
|
|
1902
|
-
window.removeEventListener(Ee,
|
|
1827
|
+
return window.addEventListener(Ee, h), () => {
|
|
1828
|
+
window.removeEventListener(Ee, h), clearTimeout(c.current);
|
|
1903
1829
|
};
|
|
1904
|
-
}, [s,
|
|
1905
|
-
const
|
|
1906
|
-
(
|
|
1907
|
-
clearTimeout(
|
|
1830
|
+
}, [s, b]);
|
|
1831
|
+
const O = S(
|
|
1832
|
+
(h, k, $) => {
|
|
1833
|
+
clearTimeout(c.current), v.current !== k && (u(0), w(!1), H(!1)), v.current = k, ue(Se($)), p(h), window.dispatchEvent(
|
|
1908
1834
|
new CustomEvent(Ee, { detail: s })
|
|
1909
1835
|
);
|
|
1910
1836
|
},
|
|
1911
1837
|
[s]
|
|
1912
|
-
),
|
|
1913
|
-
(
|
|
1914
|
-
if (
|
|
1915
|
-
|
|
1838
|
+
), U = S(
|
|
1839
|
+
(h) => {
|
|
1840
|
+
if (h === !0) {
|
|
1841
|
+
const $ = document.activeElement, j = $ instanceof HTMLElement && v.current?.contains($);
|
|
1842
|
+
b(), j && $.blur();
|
|
1916
1843
|
return;
|
|
1917
1844
|
}
|
|
1918
|
-
const
|
|
1919
|
-
|
|
1845
|
+
const k = typeof h == "object" ? h.relatedTarget : null;
|
|
1846
|
+
k?.closest?.("[data-virtual-input], [data-virtual-keypad]") || !k && N.current || (clearTimeout(c.current), c.current = setTimeout(b, 0));
|
|
1920
1847
|
},
|
|
1921
|
-
[
|
|
1848
|
+
[b]
|
|
1922
1849
|
);
|
|
1923
|
-
|
|
1924
|
-
if (!
|
|
1925
|
-
const
|
|
1926
|
-
const
|
|
1927
|
-
if (!
|
|
1928
|
-
const
|
|
1929
|
-
|
|
1850
|
+
z(() => {
|
|
1851
|
+
if (!Y || !y || x.scale !== 1) return;
|
|
1852
|
+
const h = requestAnimationFrame(() => {
|
|
1853
|
+
const k = v.current?.getBoundingClientRect();
|
|
1854
|
+
if (!k) return;
|
|
1855
|
+
const $ = x.offsetTop + x.height - y - 16;
|
|
1856
|
+
k.bottom > $ && window.scrollBy({ top: k.bottom - $, behavior: "instant" });
|
|
1930
1857
|
});
|
|
1931
|
-
return () => cancelAnimationFrame(
|
|
1858
|
+
return () => cancelAnimationFrame(h);
|
|
1932
1859
|
}, [
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1860
|
+
m,
|
|
1861
|
+
Y,
|
|
1862
|
+
y,
|
|
1863
|
+
x.height,
|
|
1864
|
+
x.offsetTop,
|
|
1865
|
+
x.scale
|
|
1939
1866
|
]);
|
|
1940
|
-
const
|
|
1941
|
-
|
|
1942
|
-
}, [
|
|
1943
|
-
() => u((
|
|
1867
|
+
const de = S(() => {
|
|
1868
|
+
me(J.mode) === null && X((h) => !h);
|
|
1869
|
+
}, [J.mode, X]), W = S(
|
|
1870
|
+
() => u((h) => (h + 1) % 3),
|
|
1944
1871
|
[]
|
|
1945
|
-
),
|
|
1946
|
-
() => u((
|
|
1872
|
+
), d = S(
|
|
1873
|
+
() => u((h) => h === 1 ? 0 : h),
|
|
1947
1874
|
[]
|
|
1948
|
-
),
|
|
1949
|
-
w(!0),
|
|
1950
|
-
}, []),
|
|
1951
|
-
w(!1),
|
|
1952
|
-
}, []),
|
|
1953
|
-
() =>
|
|
1875
|
+
), ne = S(() => {
|
|
1876
|
+
w(!0), H(!1);
|
|
1877
|
+
}, []), ie = S(() => {
|
|
1878
|
+
w(!1), H(!1);
|
|
1879
|
+
}, []), G = S(
|
|
1880
|
+
() => H((h) => !h),
|
|
1954
1881
|
[]
|
|
1955
1882
|
);
|
|
1956
|
-
return /* @__PURE__ */
|
|
1957
|
-
|
|
1883
|
+
return /* @__PURE__ */ q(
|
|
1884
|
+
We.Provider,
|
|
1958
1885
|
{
|
|
1959
1886
|
value: {
|
|
1960
|
-
inputRef:
|
|
1961
|
-
focusId:
|
|
1962
|
-
onFocus:
|
|
1963
|
-
onBlur:
|
|
1887
|
+
inputRef: f,
|
|
1888
|
+
focusId: m,
|
|
1889
|
+
onFocus: O,
|
|
1890
|
+
onBlur: U,
|
|
1964
1891
|
defaultLayout: n,
|
|
1965
|
-
hangulMode:
|
|
1892
|
+
hangulMode: R,
|
|
1966
1893
|
shift: l > 0,
|
|
1967
1894
|
shiftLocked: l === 2,
|
|
1968
|
-
theme: a ??
|
|
1969
|
-
toggleKorean:
|
|
1970
|
-
toggleShift:
|
|
1971
|
-
consumeShift:
|
|
1972
|
-
selectionMode:
|
|
1973
|
-
selectionAdjusting:
|
|
1974
|
-
enterSelectionMode:
|
|
1975
|
-
exitSelectionMode:
|
|
1976
|
-
toggleSelectionAdjust:
|
|
1977
|
-
activeInputPolicy:
|
|
1978
|
-
editingStatus:
|
|
1979
|
-
setEditingStatus:
|
|
1895
|
+
theme: a ?? B,
|
|
1896
|
+
toggleKorean: de,
|
|
1897
|
+
toggleShift: W,
|
|
1898
|
+
consumeShift: d,
|
|
1899
|
+
selectionMode: V,
|
|
1900
|
+
selectionAdjusting: Q,
|
|
1901
|
+
enterSelectionMode: ne,
|
|
1902
|
+
exitSelectionMode: ie,
|
|
1903
|
+
toggleSelectionAdjust: G,
|
|
1904
|
+
activeInputPolicy: J,
|
|
1905
|
+
editingStatus: le,
|
|
1906
|
+
setEditingStatus: F
|
|
1980
1907
|
},
|
|
1981
1908
|
children: [
|
|
1982
1909
|
e,
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
/* @__PURE__ */
|
|
1910
|
+
Y && /* @__PURE__ */ q(Me, { children: [
|
|
1911
|
+
Te(
|
|
1912
|
+
/* @__PURE__ */ T(
|
|
1986
1913
|
"div",
|
|
1987
1914
|
{
|
|
1988
1915
|
"aria-hidden": "true",
|
|
1989
1916
|
style: {
|
|
1990
|
-
height:
|
|
1917
|
+
height: y,
|
|
1991
1918
|
pointerEvents: "none",
|
|
1992
|
-
background: (a ??
|
|
1919
|
+
background: (a ?? B) === "dark" ? "#121c17" : "#f7f8f4"
|
|
1993
1920
|
}
|
|
1994
1921
|
}
|
|
1995
1922
|
),
|
|
1996
1923
|
document.body
|
|
1997
1924
|
),
|
|
1998
|
-
/* @__PURE__ */
|
|
1999
|
-
|
|
1925
|
+
/* @__PURE__ */ T(
|
|
1926
|
+
mt,
|
|
2000
1927
|
{
|
|
2001
|
-
layout:
|
|
2002
|
-
viewport:
|
|
2003
|
-
onHeightChange:
|
|
1928
|
+
layout: V ? yt : J.layout,
|
|
1929
|
+
viewport: x,
|
|
1930
|
+
onHeightChange: A
|
|
2004
1931
|
},
|
|
2005
|
-
|
|
1932
|
+
m
|
|
2006
1933
|
)
|
|
2007
1934
|
] })
|
|
2008
1935
|
]
|
|
@@ -2010,6 +1937,6 @@ function Kt({
|
|
|
2010
1937
|
);
|
|
2011
1938
|
}
|
|
2012
1939
|
export {
|
|
2013
|
-
|
|
2014
|
-
|
|
1940
|
+
Mt as VirtualInput,
|
|
1941
|
+
Tt as VirtualInputProvider
|
|
2015
1942
|
};
|