@powerduck/md-editor 0.3.0 → 0.5.0
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.md +101 -4
- package/dist/Editor.d.ts +20 -0
- package/dist/Renderer.d.ts +17 -0
- package/dist/icons.d.ts +1 -0
- package/dist/index.cjs +21 -7
- package/dist/index.d.ts +39 -12
- package/dist/index.mjs +1434 -1111
- package/dist/plugins/keyboard.d.ts +22 -0
- package/dist/plugins/math.d.ts +1 -5
- package/dist/plugins/tips.d.ts +2 -0
- package/dist/style.css +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Keyboard shortcut manager for the editor.
|
|
3
|
+
* Maps key combinations to action names. Used by the toolbar to wire up
|
|
4
|
+
* shortcuts and by the Help dialog to display them.
|
|
5
|
+
*/
|
|
6
|
+
export interface ShortcutDef {
|
|
7
|
+
action: string;
|
|
8
|
+
/** e.g. 'Mod-b' where Mod = Ctrl on Windows/Linux, Cmd on macOS */
|
|
9
|
+
key: string;
|
|
10
|
+
description: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const DEFAULT_SHORTCUTS: readonly ShortcutDef[];
|
|
13
|
+
/**
|
|
14
|
+
* Parse a shortcut string like 'Mod-b' or 'Mod-Alt-1' into a matcher function.
|
|
15
|
+
* 'Mod' maps to Meta (Cmd) on macOS and Ctrl elsewhere.
|
|
16
|
+
*/
|
|
17
|
+
export declare function matchShortcut(shortcut: string, e: KeyboardEvent): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Format a shortcut for display in the Help dialog.
|
|
20
|
+
* e.g. 'Mod-b' -> 'Ctrl+B' (Windows) or 'Cmd+B' (macOS)
|
|
21
|
+
*/
|
|
22
|
+
export declare function formatShortcut(shortcut: string): string;
|
package/dist/plugins/math.d.ts
CHANGED