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