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