openEditor opens the editor as a modal over the page.
@embededitor/full/react and @embededitor/full/standalone.
Parameters
Omit<EmbedEditorProps, 'layout'>
default:"{}"
Every prop
EmbedEditor takes except layout: the modal is its own layout. See Props.Returns
The editor’s handle,EmbedEditorHandle: its commands, reads and events. See Commands. Beside them:
() => void
Closes the modal from code.
onClose is called once it has gone.Behavior
- The modal opens in its own host on
document.body, as a dialog on a desktop and as a bottom sheet on a phone. - Save closes it once
onProcessreturns. IfonProcessthrows, the modal stays open, so the user can save again. closeOnEscapedecides whether Escape closes it. Close and Save always do.- However it closes (
close, its Close button, Escape, a Save that went through, the commandseditor.closeandoutput.save), its handle takes no more commands: every command waiting, and every one called after, rejects withNOT_AVAILABLE. openEditortouches the DOM, so call it from an event handler or an effect, never during a server render.
Example
edit-photo.ts