typewriter-editor / typewriter

A rich text editor based off of Quill.js and Ultradom, and using Svelte for UI.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Entry point for custom actions module

scarroll32 opened this issue · comments

commented

Provide a simple way to extend Typewriter based on selections, applications could be

  • pop up styling menu (aka Medium)
  • additional context for sections of text (word lookups, audio etc)

Edit: updates for API changes

This is a documentation task. To do this you would:

  • listen to the change event
  • check if the selection is not null and not collapsed (isCollapsed = selection[0] === selection[1])
  • get the selected bounding rect rect = editor.getBounds(selection)

We could also add an example for a custom use-case.