typograph-editor-documentation
    Preparing search index...

    Class Editor

    The editor as a thing you construct.

    new Typograph.Editor({ container: '#app' })
    

    Available on the global Typograph object, assigned at runtime from this ESM bundle rather than through esbuild's --global-name. PLAN-npm-module.md called for an iife build to get the global, which would have silently broken every editor asset: esbuild empties import.meta.url in iife output, and assetUrl() resolves icons, cursors and the stylesheet against it (ASSESSMENT-editor-viewer-canvas-architecture.md §3.3).

    Constructing one is optional. A page that just loads editor.js still gets an editor mounted on document.body, which is what every existing host relies on.

    Single instance: constructing a second Editor destroys the first. Running two side by side needs the canvas's g_typograph_document singleton undone, which is deferred — see the assessment, §3.4.

    Index
    • Remove the editor's DOM and styles.

      Constructing a new Editor afterwards is NOT supported yet: the canvas document has no teardown, so its state would survive and the second boot would build on top of it. That needs a canvas-side dispose before this can be a real lifecycle.

      Returns void

    • The canvas document, once the editor has booted.

      Returns typograph_document