Editor commands API / effects (#1778)
This PR shrinks the commands API surface and adds a manager (`CleanupManager`) for side effects. ### Change Type - [x] `major` — Breaking change ### Test Plan Use the app! Especially undo and redo. Our tests are passing but I've found more cases where our coverage fails to catch issues. ### Release Notes - tbd
This commit is contained in:
parent
03514c00c4
commit
e17074a8b3
139 changed files with 3741 additions and 2701 deletions
|
@ -84,12 +84,14 @@ export function useCanvasEvents() {
|
|||
|
||||
const files = Array.from(e.dataTransfer.files)
|
||||
|
||||
// the drop point should be offset by the position of the editor's container
|
||||
const rect = editor.getContainer().getBoundingClientRect()
|
||||
const point = editor.screenToPage({ x: e.clientX - rect.x, y: e.clientY - rect.y })
|
||||
|
||||
await editor.putExternalContent({
|
||||
type: 'files',
|
||||
files,
|
||||
point: editor.screenToPage(e.clientX - rect.x, e.clientY - rect.y),
|
||||
point,
|
||||
ignoreParent: false,
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue