@infinity_cheng/dsh-prompt-editor 0.3.0 → 0.3.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.
Files changed (3) hide show
  1. package/README.md +6 -2
  2. package/client.js +3 -3
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -47,7 +47,7 @@ Client 可以热更新,但 Host 的 JavaScript 模块换代必须**完全退
47
47
  ## 输入框按钮
48
48
 
49
49
  1. 在输入框里输入草稿,或选中其中一段。
50
- 2. 点输入框右侧的「增强」,或在输入框里按 `⌘⇧E` / `Ctrl+Shift+E`。
50
+ 2. 点输入框右侧的「增强」,或在输入框里按 `⌘E` / `Ctrl+E`(`⌘⇧E` / `Ctrl+Shift+E` 也兼容)。
51
51
  3. 预览弹窗会流式显示改写结果;左侧是原文,右侧是改写,下面是确定性检查。
52
52
  4. 选 `替换选中` / `替换全文` 才写回草稿;`重试` 可换规则重跑,`取消` 不改任何内容。
53
53
  5. 有选区时只替换选区;没有选区时替换全文。替换后仍可用输入框自己的 `Ctrl+Z` 撤销。
@@ -214,9 +214,13 @@ Safari 验证结果。
214
214
  - Host + Client 两半;Client 是 lazy-CJS bundle,无独立构建步骤
215
215
  - Client 槽位:`conversation.input.right`、`settings.section`
216
216
 
217
+ ### 0.3.1 快捷键修复
218
+
219
+ - 主快捷键改为 `⌘E` / `Ctrl+E`,避开 Mac 输入法常吞掉的 Shift+字母;`⌘⇧E` / `Ctrl+Shift+E` 仍兼容。
220
+
217
221
  ### 0.3.0 Phase 2
218
222
 
219
- - 输入框内 `⌘⇧E` / `Ctrl+Shift+E` 打开增强。
223
+ - 输入框内 `⌘E` / `Ctrl+E` 打开增强;兼容 `⌘⇧E` / `Ctrl+Shift+E`。
220
224
  - 含引用块的草稿可选中不含引用块的一段增强,引用块原样保留;全文替换含引用块仍不支持。
221
225
 
222
226
  ### 0.2.1 修复
package/client.js CHANGED
@@ -23,7 +23,7 @@ window.__ModuleLoader__.load({
23
23
  const OPEN_TAG = '<enhanced_prompt>'
24
24
  const CLOSE_TAG = '</enhanced_prompt>'
25
25
  const IS_MAC = typeof navigator !== 'undefined' && /Mac|iPhone|iPad/.test(navigator.platform || '')
26
- const SHORTCUT_LABEL = IS_MAC ? '⌘⇧E' : 'Ctrl+Shift+E'
26
+ const SHORTCUT_LABEL = IS_MAC ? '⌘E' : 'Ctrl+E'
27
27
 
28
28
  const FALLBACK = {
29
29
  'meta.title': '提示词增强',
@@ -519,8 +519,8 @@ window.__ModuleLoader__.load({
519
519
  useEffect(() => {
520
520
  const onKey = (event) => {
521
521
  if (open) return
522
- if (!(event.metaKey || event.ctrlKey) || !event.shiftKey) return
523
- if (event.key.toLowerCase() !== 'e') return
522
+ if (!(event.metaKey || event.ctrlKey) || event.altKey) return
523
+ if (event.code !== 'KeyE' && event.key.toLowerCase() !== 'e') return
524
524
  const target = event.target
525
525
  if (!(target instanceof HTMLElement)) return
526
526
  if (target.closest('[contenteditable="true"]') === null
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infinity_cheng/dsh-prompt-editor",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Rewrite a rough prompt draft into a clear, executable prompt in DeepSeek Harness: streaming preview, selection-aware replace, and fact-preservation checks.",
5
5
  "icon": "icon.svg",
6
6
  "type": "module",