@liquid-js/underflow
    Preparing search index...

    Class Editor

    EditorCore with the default UI: the toolbar, the mode switch and the popups.

    Hierarchy (View Summary)

    Index
    eventEmitter: Emitter
    options: Required<EditorOptions>
    • Stops the user from changing the text, or lets them again. A read-only editor's text can still be focused, read, selected and copied, as a read-only field's, and the Write and Preview tabs still switch; its toolbar and the mode switch are disabled. The API, e.g. setMarkdown(), still changes the text.

      Parameters

      • readonly: boolean

      Returns void

    • Disables the editor, or enables it again. A disabled editor is read-only, see setReadonly(), in the disabled colour, and out of the Tab order, as a disabled field: its text, the preview and the tabs too. Its text can still be clicked to select and copy it. The API still changes the text.

      Parameters

      • disabled: boolean

      Returns void

    • Sets ARIA attributes of the editable text, in both modes, e.g. to name it after a form field's label, describe it or mark it invalid or required; the attributes not given stay as they are, and one given as undefined is removed. They're on the text of both modes, so they stay when the mode changes.

      Parameters

      Returns void

    • Runs a command in the current mode.

      Parameters

      • name: string
      • Optionalpayload: Record<string, any>

      Returns void

    • Moves the cursor to the start of a line (1-based); in WYSIWYG, each text block, table row and code line is a line.

      Parameters

      • line: number
      • focus: boolean = true

      Returns void

    • focus applies when the cursor moves to the end.

      Parameters

      • markdown: string = ''
      • cursorToEnd: boolean = true
      • focus: boolean = true

      Returns void

    • Sets the content from HTML, converted to markdown; focus applies when the cursor moves to the end.

      Parameters

      • html: string = ''
      • cursorToEnd: boolean = true
      • focus: boolean = true

      Returns void

    • Parameters

      • itemName: string

      Returns void

    • Registers the UI texts of a language under its codes.

      Parameters

      • code: string | string[]
      • data: Record<string, string>

      Returns void

    • Replaces the editor's icons by name, e.g. { bold: '<svg …>…</svg>' }, in its toolbar, menus and widgets, for the editors made from then on; an icon given as undefined gets its own back.

      Parameters

      • icons: Partial<Record<IconName, string>>

        SVG markup by icon name: the class name of its toolbar button or menu item

      Returns void