@qnroa/qtype 0.2.3 → 0.2.4
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/CHANGELOG.md +40 -0
- package/CHANGELOG.zh.md +32 -0
- package/dist/core/typing/engine/TypingInput.js +50 -29
- package/dist/view/assets/index-Cve31o1m.js +219 -0
- package/dist/view/assets/{index-Cj70GP_V.js → index-D2_Nabek.js} +1 -1
- package/dist/view/assets/index-qklN7dNP.js +3 -0
- package/dist/view/index.html +1 -1
- package/package.json +1 -1
- package/dist/view/assets/index-B_3g67jY.js +0 -3
- package/dist/view/assets/index-CeFBpbIw.js +0 -194
package/CHANGELOG.md
CHANGED
|
@@ -13,6 +13,46 @@ can land in any minor bump (`0.x.0`).
|
|
|
13
13
|
|
|
14
14
|
## [Unreleased]
|
|
15
15
|
|
|
16
|
+
## [0.2.4] — 2026-09-08
|
|
17
|
+
|
|
18
|
+
Bug-fix + refactor pass around the ignore-punctuation setting and the
|
|
19
|
+
plumbing that surfaces settings in the command palette and HUD menu.
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
- **Ignore-punctuation used to eat operators.** `+`, `-`, `*`, `/`,
|
|
23
|
+
`=`, `<`, `>`, `(`, `)` and other code / math symbols were treated
|
|
24
|
+
as punctuation, so turning the setting on rewrote whole code
|
|
25
|
+
passages into runs of blanks. The punctuation set is now the same
|
|
26
|
+
9 ASCII marks keybr / ptype / Monkeytype recognise
|
|
27
|
+
(`. , ! ? ; : ' " -` — sentence and clause marks only) plus the
|
|
28
|
+
corresponding CJK sentence marks, smart quotes, and Chinese book /
|
|
29
|
+
corner-bracket pairs. Operators and brackets pass through
|
|
30
|
+
unchanged.
|
|
31
|
+
- **Arena stale-render after toggling ignore-punctuation.** Switching
|
|
32
|
+
the setting mid-card left the arena rendered against the previous
|
|
33
|
+
engine's target for a tick, so punctuation slots appeared to
|
|
34
|
+
linger until the next event. The arena is now keyed on
|
|
35
|
+
`${card.id}::${engine.target}`, forcing a full remount whenever
|
|
36
|
+
the engine's effective target changes — no stale
|
|
37
|
+
`useSyncExternalStore` subscription, no leftover DOM.
|
|
38
|
+
|
|
39
|
+
### Changed
|
|
40
|
+
- **HUD ⋮ menu is now registry-driven.** Every settings entry that
|
|
41
|
+
opts in via `hud: { icon, order? }` shows up as a quick toggle
|
|
42
|
+
during typing. `hint`, `ignoreCase`, `ignorePunctuation`,
|
|
43
|
+
`allowBackspace`, `showKeyboard`, `showHands` land in the menu by
|
|
44
|
+
default; `showPhonetic`, `showGloss`, `autoSpeak` show up on word
|
|
45
|
+
/ sentence cards. Adding a new HUD toggle is now one registry
|
|
46
|
+
line.
|
|
47
|
+
- **Command palette lists every setting.** The palette walks the
|
|
48
|
+
settings registry and emits a `setting.<id>` command per entry —
|
|
49
|
+
bool settings toggle inline; enum / number / action settings open
|
|
50
|
+
the settings dialog scrolled to the row. No more manually adding
|
|
51
|
+
palette entries for each new setting.
|
|
52
|
+
- **`useHint()` extracted.** Three call sites were inlining the
|
|
53
|
+
same `usePersistedState<HintMode>('settings', 'hint', ...)` block;
|
|
54
|
+
they all use the shared hook now.
|
|
55
|
+
|
|
16
56
|
## [0.2.3] — 2026-09-07
|
|
17
57
|
|
|
18
58
|
Fixes long-standing bugs around Chinese IME input on the typing arena
|
package/CHANGELOG.zh.md
CHANGED
|
@@ -12,6 +12,38 @@ English: [CHANGELOG.md](https://www.npmjs.com/package/@qnroa/qtype?activeTab=cod
|
|
|
12
12
|
|
|
13
13
|
## [Unreleased]
|
|
14
14
|
|
|
15
|
+
## [0.2.4] — 2026-09-08
|
|
16
|
+
|
|
17
|
+
围绕"忽略标点"设置和"命令面板 / HUD 菜单如何呈现设置"两件事,
|
|
18
|
+
做了一轮修复和小重构。
|
|
19
|
+
|
|
20
|
+
### 修复
|
|
21
|
+
- **忽略标点误伤运算符。** 之前 `+ - * / = < > ( )` 等代码 / 数学
|
|
22
|
+
符号都被当成标点,一开设置就把整段代码替换成空格。改成和
|
|
23
|
+
keybr / ptype / Monkeytype 一致的 9 个 ASCII 句读
|
|
24
|
+
(`. , ! ? ; : ' " -`),加上对应的中文句号 / 逗号 / 冒号 / 分号 /
|
|
25
|
+
问号 / 感叹号 / 顿号 + 中文引号 / 书名号 / 角括号。运算符和括号
|
|
26
|
+
一律不动。
|
|
27
|
+
- **切换忽略标点后 arena 一瞬间残留旧渲染。** 卡片打字中途切设置,
|
|
28
|
+
引擎重建了但 arena 的 fiber 被复用,`useSyncExternalStore`
|
|
29
|
+
订阅还挂在旧 engine 上,标点位置视觉错乱,得刷新才好。arena
|
|
30
|
+
的 React key 改成 `${card.id}::${engine.target}`,engine 目标
|
|
31
|
+
一变就整棵重挂,零残留。
|
|
32
|
+
|
|
33
|
+
### 变更
|
|
34
|
+
- **HUD ⋮ 菜单改为注册表驱动。** 设置条目里加 `hud: { icon, order? }`
|
|
35
|
+
就自动出现在打字时的快捷菜单。默认加入的:显示提示、忽略大小写、
|
|
36
|
+
忽略标点、允许退格、显示键盘、显示手位;word / sentence 卡片
|
|
37
|
+
额外多显示音标 / 释义 / 自动朗读。加一个 HUD 快捷开关现在只需
|
|
38
|
+
改注册表一行。
|
|
39
|
+
- **命令面板列出所有设置。** 面板遍历设置注册表,给每个条目生成一条
|
|
40
|
+
`setting.<id>` 命令。bool 类型直接就地翻转;枚举 / 数字 / action
|
|
41
|
+
打开设置对话框并高亮那一行。新增设置不再需要单独往命令面板加
|
|
42
|
+
条目。
|
|
43
|
+
- **抽出 `useHint()` hook。** 之前 3 个地方内联同样的
|
|
44
|
+
`usePersistedState<HintMode>('settings', 'hint', ...)`,现在统一用
|
|
45
|
+
这个 hook。
|
|
46
|
+
|
|
15
47
|
## [0.2.3] — 2026-09-07
|
|
16
48
|
|
|
17
49
|
修复打字界面在中文输入法下的一系列老问题,并把"忽略标点"的行为
|
|
@@ -216,35 +216,56 @@ function sameLetter(a, b) {
|
|
|
216
216
|
return false;
|
|
217
217
|
}
|
|
218
218
|
/**
|
|
219
|
-
*
|
|
220
|
-
*
|
|
221
|
-
* (
|
|
219
|
+
* Sentence / clause punctuation, per keybr + ptype + Monkeytype
|
|
220
|
+
* conventions. Explicitly excludes math operators (`+ - * / = < >`),
|
|
221
|
+
* brackets (`( ) [ ] { }`), and code-symbol characters (`_ | \ @ # $
|
|
222
|
+
* % & ^ ~ \``) — those show up in real prose and code and should be
|
|
223
|
+
* typed as-is, not silently rewritten to space.
|
|
224
|
+
*
|
|
225
|
+
* Uses an inline set of codepoints instead of `\p{P}` — the Unicode
|
|
226
|
+
* punctuation category also matches math / brackets / dashes we want
|
|
227
|
+
* to leave alone, which is exactly why every mainstream typing app
|
|
228
|
+
* hard-codes its own list.
|
|
222
229
|
*/
|
|
223
230
|
function isPunctuation(cp) {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
231
|
+
switch (cp) {
|
|
232
|
+
// ASCII sentence / clause marks. . , ! ? ; : ' "
|
|
233
|
+
case 0x2e:
|
|
234
|
+
case 0x2c:
|
|
235
|
+
case 0x21:
|
|
236
|
+
case 0x3f:
|
|
237
|
+
case 0x3b:
|
|
238
|
+
case 0x3a:
|
|
239
|
+
case 0x27:
|
|
240
|
+
case 0x22:
|
|
241
|
+
// CJK sentence marks: 。 、
|
|
242
|
+
case 0x3001:
|
|
243
|
+
case 0x3002:
|
|
244
|
+
// Fullwidth forms: ! ? , : ; ' "
|
|
245
|
+
case 0xff01:
|
|
246
|
+
case 0xff1f:
|
|
247
|
+
case 0xff0c:
|
|
248
|
+
case 0xff1a:
|
|
249
|
+
case 0xff1b:
|
|
250
|
+
case 0xff07:
|
|
251
|
+
case 0xff02:
|
|
252
|
+
// Smart quotes: " " ' '
|
|
253
|
+
case 0x201c:
|
|
254
|
+
case 0x201d:
|
|
255
|
+
case 0x2018:
|
|
256
|
+
case 0x2019:
|
|
257
|
+
// Book title marks: 《 》 〈 〉
|
|
258
|
+
case 0x300a:
|
|
259
|
+
case 0x300b:
|
|
260
|
+
case 0x3008:
|
|
261
|
+
case 0x3009:
|
|
262
|
+
// CJK corner brackets: 「 」 『 』
|
|
263
|
+
case 0x300c:
|
|
264
|
+
case 0x300d:
|
|
265
|
+
case 0x300e:
|
|
266
|
+
case 0x300f:
|
|
267
|
+
return true;
|
|
268
|
+
default:
|
|
269
|
+
return false;
|
|
270
|
+
}
|
|
250
271
|
}
|