@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/dist/components/form/inputs/RichText/composables/useEditorKeyboard.d.ts.map +1 -1
- package/dist/components/form/inputs/RichText/index.vue.d.ts.map +1 -1
- package/dist/components/form/inputs/RichText/utils/commands.d.ts.map +1 -1
- package/dist/components/form/inputs/RichText/utils/formatting.d.ts.map +1 -1
- package/dist/core.css +2 -2
- package/dist/index.cjs +130 -110
- package/dist/index.css +1 -1
- package/dist/index.mjs +9733 -9598
- package/dist/style.css +2 -2
- package/package.json +1 -1
- package/src/components/form/inputs/RichText/composables/useEditorKeyboard.ts +8 -5
- package/src/components/form/inputs/RichText/index.vue +277 -66
- package/src/components/form/inputs/RichText/utils/commands.ts +48 -3
- package/src/components/form/inputs/RichText/utils/formatting.ts +5 -1
- package/src/components/form/inputs/Upload/UploadInput.vue +1 -1
- package/src/styles/appearance.css +50 -0
package/package.json
CHANGED
|
@@ -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 =
|
|
44
|
-
(
|
|
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
|
})
|