@bagelink/vue 1.15.515 → 1.15.521

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/vue",
3
3
  "type": "module",
4
- "version": "1.15.515",
4
+ "version": "1.15.521",
5
5
  "description": "Bagel core sdk packages",
6
6
  "author": {
7
7
  "name": "Bagel Studio",
@@ -40,16 +40,19 @@ export function useEditorKeyboard(doc: Document, executor: CommandExecutor): voi
40
40
 
41
41
  const matchingShortcut = shortcuts.find((shortcut) => {
42
42
  const keyMatch = shortcut.key === e.key
43
- const modifiersMatch = !shortcut.modifiers || (
44
- (!shortcut.modifiers.ctrl || e.ctrlKey || e.metaKey)
45
- && (!shortcut.modifiers.alt || e.altKey)
46
- && (!shortcut.modifiers.shift || e.shiftKey)
47
- )
43
+ const modifiersMatch = Boolean(shortcut.modifiers?.alt) === e.altKey
44
+ && Boolean(shortcut.modifiers?.shift) === e.shiftKey
48
45
  return keyMatch && modifiersMatch
49
46
  })
50
47
 
51
48
  if (matchingShortcut) {
52
49
  e.preventDefault()
50
+ // Keep text editing history scoped to the iframe. The browser groups
51
+ // typing into granular transactions, while the editor's HTML snapshot
52
+ // history is intended for structural toolbar operations.
53
+ if (matchingShortcut.command === 'undo' || matchingShortcut.command === 'redo') {
54
+ if (doc.execCommand(matchingShortcut.command)) { return }
55
+ }
53
56
  executor.execute(matchingShortcut.command)
54
57
  }
55
58
  })