@uiwwsw/virtual-keyboard 2.1.0 → 2.2.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.en.md ADDED
@@ -0,0 +1,73 @@
1
+ # React Virtual Keyboard
2
+
3
+ [한국어](README.md) · [Live demo](https://virtual-keyboard-uiwwsw.vercel.app/en/) · [npm](https://www.npmjs.com/package/@uiwwsw/virtual-keyboard)
4
+
5
+ An accessible React on-screen keyboard with Korean Hangul composition, English input, numeric and phone keypads, custom layouts and input policies. Virtual Keyboard is the product name; custom keypads are one feature. Supports React 18 and 19.
6
+
7
+ ## Installation
8
+
9
+ ```sh
10
+ npm install @uiwwsw/virtual-keyboard
11
+ ```
12
+
13
+ ## Usage
14
+
15
+ ```tsx
16
+ "use client";
17
+ import { useState } from "react";
18
+ import { VirtualInput, VirtualInputProvider } from "@uiwwsw/virtual-keyboard";
19
+
20
+ export default function Example() {
21
+ const [value, setValue] = useState("");
22
+ return (
23
+ <VirtualInputProvider locale="en" keyboardVisibility="always">
24
+ <VirtualInput
25
+ mode="text"
26
+ value={value}
27
+ onValueChange={setValue}
28
+ aria-label="Your message"
29
+ maxLength={48}
30
+ />
31
+ </VirtualInputProvider>
32
+ );
33
+ }
34
+ ```
35
+
36
+ The `locale` option is available in the source update documented here; check the installed package version before using a newly added option. It changes keyboard labels, accessibility text and clipboard status messages, not user-entered text or the input language. Default: `ko`. `en` provides English labels.
37
+
38
+ ## Input modes
39
+
40
+ | Mode | Accepted input |
41
+ | ------------ | ------------------------------------------------ |
42
+ | text | Free text with Korean/English keyboard switching |
43
+ | hangul | Korean composition |
44
+ | number | Numeric input and decimal point |
45
+ | tel | Digits and +, *, # |
46
+ | alpha | English letters |
47
+ | alphanumeric | English letters and digits |
48
+ | custom | Your configured key layout and macro values |
49
+
50
+ The same character policies apply to typing and pasting. Keyboard visibility can be auto, always or never. Themes can be light/dark or follow the system. Use value/onValueChange for string state, and provide an accessible input label. The input uses normal DOM, supports selection, editing, clipboard feedback and physical keys.
51
+
52
+ ## Custom keys
53
+
54
+ ```tsx
55
+ import type { KeypadLayout } from "@uiwwsw/virtual-keyboard";
56
+ const layout: KeypadLayout = [
57
+ [
58
+ { label: "Hello", value: "Hello! " },
59
+ { label: "Thanks", value: "Thank you. " },
60
+ ],
61
+ [
62
+ { value: "Backspace", type: "action" },
63
+ { value: "Enter", type: "action" },
64
+ ],
65
+ ];
66
+ // Pass mode="custom" layout={layout} to VirtualInput.
67
+ ```
68
+
69
+ ## Development
70
+
71
+ Use a supported Node version from package.json. Run npm ci and npm run check; the demo build is demo-dist, the library build is dist. Follow workspace SSD rules when applicable. The Korean reference README covers the full API and migration notes; its code identifiers apply in either language.
72
+
73
+ MIT license. Use the GitHub issue tracker for bugs and feature requests.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  한글 조합과 커스텀 키패드를 지원하는 React 가상 키보드입니다. 입력란은 실제 `<input inputMode="none">`을 사용해 커서·길게 누르기·선택을 브라우저에 맡기며, 화면 키패드는 Shadow DOM 안의 실제 버튼으로 렌더링됩니다.
4
4
 
5
- [데모](https://composed-input.vercel.app/) · [npm](https://www.npmjs.com/package/@uiwwsw/virtual-keyboard) · [MIT License](./LICENSE)
5
+ [데모](https://virtual-keyboard-uiwwsw.vercel.app/) · [npm](https://www.npmjs.com/package/@uiwwsw/virtual-keyboard) · [MIT License](./LICENSE)
6
6
 
7
7
  ## Installation
8
8
 
@@ -159,12 +159,22 @@ ref.current?.setSelectionRange(0, 2);
159
159
  - Shift는 한 번 누르면 다음 문자에 적용되고, 두 번 누르면 고정됩니다. 세 번째 입력으로 해제됩니다.
160
160
  - 탭, 길게 누르기, 드래그, 스크롤은 실제 input의 기본 제스처로 처리합니다. 앱에서 터치 위치를 커서로 환산하거나 손을 뗄 때 다시 선택하지 않습니다.
161
161
  - `selectionStart`·`selectionEnd`·`selectionDirection`을 편집 엔진과 동기화합니다. 자체 길게 누르기 타이머와 가짜 커서가 없어 브라우저가 정한 커서·선택 상태를 뒤늦게 덮어쓰지 않습니다.
162
- - 선택하면 현재 자판 위에 `복사`·`잘라내기`·`전체 선택`이 바로 표시됩니다. 선택 손잡이와 기본 복사 메뉴의 표시·모양은 기기와 브라우저가 결정합니다. `편집` 키의 화살표·범위 조절도 계속 사용할 수 있습니다.
162
+ - 선택하면 현재 자판 위에 `복사`·`잘라내기`·`붙여넣기`가 바로 표시됩니다. `전체 선택`은 `편집` 화면에서 사용할 수 있습니다. 선택 손잡이와 기본 복사 메뉴의 표시·모양은 기기와 브라우저가 결정합니다. `편집` 키의 화살표·범위 조절도 계속 사용할 수 있습니다.
163
163
  - 화면 키는 손을 뗄 때 실행됩니다. 누른 채 키 밖으로 움직이거나 터치가 취소되면 실행하지 않습니다. 지우기·화살표는 길게 누르면 반복하고 키 밖으로 움직이면 멈춥니다.
164
164
  - 키패드의 클립보드 버튼은 보안 컨텍스트와 브라우저 권한이 필요할 수 있습니다. 복사는 Clipboard API 실패 시 실제 선택 영역의 기본 복사 이벤트를 대체 경로로 시도합니다. 실패는 보이는 상태 메시지와 `onClipboardError`로 전달합니다. 기본 복사 메뉴와 물리 키보드 단축키도 지원합니다.
165
165
 
166
166
  입력란과 키는 실제 HTML input·button으로 렌더링되며 스크린 리더에 노출됩니다. 자동 접근성 검사는 보조기기 실기기 검증을 대체하지 않습니다.
167
167
 
168
+ ## Copy and paste
169
+
170
+ - **처음 들어와 붙여넣기:** 입력란을 탭하고 키패드 상단의 `붙여넣기`를 누릅니다. 빈 입력란과 숫자·전화번호 모드에서도 바로 사용할 수 있습니다.
171
+ - **복사한 내용을 다른 위치에 붙여넣기:** 글자를 선택해 `복사`한 다음 같은 입력란이나 다른 입력란에서 원하는 위치를 탭하고 `붙여넣기`를 누릅니다. 선택 범위가 있으면 그 부분을 교체합니다.
172
+ - 붙여넣은 내용 끝에 커서를 두고 입력란으로 포커스를 돌려 계속 입력할 수 있습니다. 붙여넣기는 한 번의 실행 취소로 되돌릴 수 있습니다.
173
+
174
+ 클립보드는 붙여넣기를 명시적으로 실행할 때 읽습니다. 읽는 동안 버튼에 진행 상태를 표시하고 연속 실행을 막습니다. 대기 중 커서·값·입력란·입력 정책이 바뀌면 요청을 취소하므로 새 위치에서 다시 눌러 주세요. 빈 클립보드, 허용되지 않는 내용, 길이 제한, 부모가 거절한 값은 완료 메시지와 구분해 알립니다.
175
+
176
+ 브라우저가 클립보드 읽기를 제한하면 현재 선택 범위를 유지하고 기본 붙여넣기 메뉴를 안내합니다. 입력란을 길게 눌러 `붙여넣기`를 선택하거나 Ctrl/Cmd + V를 사용할 수 있습니다. 기본 붙여넣기 이벤트에도 같은 입력 정책과 실행 취소를 적용합니다. OS의 권한 창과 붙여넣기 메뉴는 브라우저가 표시합니다. [Clipboard API의 브라우저별 제약](https://developer.mozilla.org/en-US/docs/Web/API/Clipboard_API#security_considerations)을 참고하세요.
177
+
168
178
  ## Development
169
179
 
170
180
  ```bash
@@ -196,3 +206,9 @@ npm의 `package-lock.json`을 의존성 기준으로 사용합니다. Vite 라
196
206
  ## Migration from 2.0
197
207
 
198
208
  2.1부터 입력란 내부는 실제 input입니다. 공개 값·ref API와 컨테이너의 `className`/`style`은 유지합니다. 내부 문자 span이나 가짜 커서를 선택하던 CSS·DOM 코드는 제거하세요. 선택 범위를 직접 읽을 때는 input의 `selectionStart`, `selectionEnd`, `selectionDirection`을 사용합니다. `id`와 접근성 속성은 실제 input으로 이동하므로 `label htmlFor`를 연결할 수 있습니다.
209
+
210
+ ## 데모 언어와 검색
211
+
212
+ [한국어 데모](https://virtual-keyboard-uiwwsw.vercel.app/) · [English demo](https://virtual-keyboard-uiwwsw.vercel.app/en/) · [English README](README.en.md)
213
+
214
+ Virtual Keyboard(버추얼 키보드)가 제품·패키지 이름입니다. 커스텀 키패드는 지원 기능 중 하나입니다. 데모는 한·영 UI, 언어별 제목·설명·초기 HTML·canonical/hreflang·사이트맵을 제공합니다. Provider의 `locale="ko" | "en"`(기본 ko)는 키보드 버튼·접근성·클립보드 상태 안내의 표시 언어이며 입력 모드와 독립적입니다. 입력 문자를 자동 번역하지 않습니다. [SEO 기록](docs/SEO.md).