mirror of
https://github.com/zsviczian/obsidian-excalidraw-plugin.git
synced 2026-11-27 06:32:42 +00:00
Claim drawing image embeds synchronously before yielding to Obsidian's native embed discovery. Preserve native images, text references and hybrid Markdown rendering, and cover main/popout PDF preparation. Correct macOS editing commands in native test input. Validation: 871 portable cases passed, PDF/embed and installed K-Plex checks passed. Separate native Mac Cmd+S and failed-path cleanup checks remain failing; their evidence is preserved.
9 lines
584 B
JavaScript
9 lines
584 B
JavaScript
/** CDP needs explicit browser editing commands for macOS shortcuts, as Playwright's Chromium driver does. */
|
|
export function nativeKeyboardInput(params, platform = process.platform) {
|
|
if (platform !== "darwin" || !["keyDown", "rawKeyDown"].includes(params.type) || params.commands) return params;
|
|
const command = params.modifiers === 4 && params.code === "KeyA" ? "selectAll"
|
|
: params.modifiers === 4 && params.code === "KeyZ" ? "undo"
|
|
: params.modifiers === 12 && params.code === "KeyZ" ? "redo" : null;
|
|
return command ? { ...params, commands: [command] } : params;
|
|
}
|