feat(shell): open documents dropped onto the window (#161)
Dropping a local file from Explorer/Finder anywhere over the app previously did nothing visible: the navigation guard blocks Chromium's default navigate-to-file, so drops were silently swallowed. Add a preload-side bridge (@genoffice/electron-utils/drop-open, installed by every surface's preload) that resolves dropped files via webUtils and forwards recognized documents to the shell over one IPC channel. The shell routes each path through the normal File > Open pipeline, reveals its window when the drop landed in a detached editor, and shows the existing "not supported" dialog for known legacy formats. Page-level drop zones that cancel their events (AI attachment panels, slides image insert) keep priority. While files hover, Home shows a pointer-events-none drop overlay (tokens only, i18n key in all 19 locales). The bridge module gets its own package subpath export so sandboxed preloads bundle only it — importing the barrel would pull node builtins into sandboxed preloads (bundled) or leave a bare require (externalized), both fatal there. Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -6,7 +6,8 @@
|
||||
"type": "module",
|
||||
"description": "Shared helpers for the Electron main processes (no Electron dependency, pure TS)",
|
||||
"exports": {
|
||||
".": "./src/index.ts"
|
||||
".": "./src/index.ts",
|
||||
"./drop-open": "./src/drop-open.ts"
|
||||
},
|
||||
"scripts": {
|
||||
"typecheck": "tsc --noEmit",
|
||||
|
||||
Reference in New Issue
Block a user