Skip to content

An experimental rich text editor framework which aims to replace the native contenteditable attribute with a self-drawn cursor to provide richer and more stable editing capabilities.

Notifications You must be signed in to change notification settings

xesrevinu/editable

 
 

Repository files navigation

zh-CN

Editable

An experimental rich text editor framework which aims to replace the native contenteditable attribute with a self-drawn cursor to provide richer and more stable editing capabilities.

Development

Use nextjs & turbo to build a development environment, use typescript for development, and use jest for unit testing.

# Install
pnpm install

# start up
pnpm dev

Directory Structure

All source codes are in packages, and the apps directory is mainly used for documentation and test cases. Now, in the initial development phase, a React rendering editor model and the logic of model update are written for visual testing.

packages/editable-breaker

Mainly index some unicode characters. Because the number of bytes occupied by some characters is uncertain, resulting in inaccurate indexes after some characters are split, so this toolkit is needed to solve this problem.

packages/editable-editor

Use the slatejs data model, and use react to render in the self-drawn cursor mode, no longer relying on the contenteditable attribute

packages/editable-plugins

plugin directory

Task

Selection

  • English keyboard input
  • combined input method input
  • cursor selection rendering
  • text input box rendering
  • Drag mouse to select selection and cursor
  • Switch cursor and selection by keyboard left and right keys
  • Switch cursor and selection by keyboard Shift+left and right keys
  • Switch cursor and selection by keyboard Shift + Up and Down keys
  • Switch cursor and selection by keyboard Ctrl+up and down keys
  • Switch cursor and selection by keyboard up and down keys
  • Double-click and triple-click to select text after word segmentation
  • touch to select selection and cursor
  • Full coverage of unit tests

Input

  • combined input method input

Plugins

  • Bold
  • Italic
  • Underline
  • StrikeThrough
  • Code
  • Sub
  • Sup
  • Fontsize
  • OrderedList
  • UnOrderedList
  • TaskList
  • Blockquote
  • Indent
  • Fontcolor
  • BackgroundColor
  • Redo
  • Undo
  • Link
  • Image
  • Codeblock
  • Heading
  • Table
  • Hr
  • Toolbar

About

An experimental rich text editor framework which aims to replace the native contenteditable attribute with a self-drawn cursor to provide richer and more stable editing capabilities.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 95.9%
  • Less 3.6%
  • Other 0.5%