Lucas.Xu 93565269f0 docs: extending.md 2 anni fa
..
assets 35bafbaadc feat: implement popup list service 2 anni fa
documentation 93565269f0 docs: extending.md 2 anni fa
example 93565269f0 docs: extending.md 2 anni fa
lib 2224aa271e docs: add documentation for selectable 2 anni fa
test ad26f9c86d fix: checkbox + underline doesn’t work when the checkbox is checked 2 anni fa
.gitignore 35d5bc92ac chore: publish preparation 2 anni fa
.metadata 76999c6a46 feat: add flowy_editor package 2 anni fa
CHANGELOG.md 3945a64820 chore: publish preparation 2 anni fa
LICENSE 76999c6a46 feat: add flowy_editor package 2 anni fa
README.md 93565269f0 docs: extending.md 2 anni fa
analysis_options.yaml 76999c6a46 feat: add flowy_editor package 2 anni fa
pubspec.yaml 2d04f79e10 chore: publish preparation 2 anni fa

README.md

FlowyEditor

An easily extensible, test-covered rich text editing component for Flutter

Features

  • Extensible
    • Support extending custom components.
    • 支持扩展自定义的组件
    • Support extending custom shortcut key parsing
    • 支持扩展自定义快捷键解析
    • Support extending toolbar/popup list(WIP)
    • 支持扩展toolbar/popup list(WIP)
    • ...
  • Collaboration Ready
    • All changes to the document are based on operation. Theoretically, collaborative editing will be supported in the future.
    • 所有对文档的修改都是基于operation。理论上未来会支持协同编辑。
  • Good stability guarantees
    • Current code coverage >= 63%, we will still continue to add more test cases.

Due to the extensible structure and the increase in functionality, we encourage each commit to add test case code under test to ensure that the other committer does not have to worry about their code affecting the existing logic as much as possible. For more testing information, please check TESTING.md

Getting started

flutter pub add flowy_editor
flutter pub get

Usage

Creates editor with empty document

final editorState = EditorState.empty();
final editor = FlowyEditor(
    editorState: editorState,
    keyEventHandlers: const [],
    customBuilders: const {},
);

Creates editor from JSON file

final json = ...;
final editorState = EditorState(StateTree.fromJson(data));
final editor = FlowyEditor(
    editorState: editorState,
    keyEventHandlers: const [],
    customBuilders: const {},
);

For more. Run the example.

git clone https://github.com/AppFlowy-IO/AppFlowy.git
cd frontend/app_flowy/packages/flowy_editor/example
flutter run

How to extends

Extending a custom components

Please refer to extending.md for more details.

Extending a custom shortcut event

Please refer to extending.md for more details.

Examples

  • Extends a custom component.
    • Checkbox Text - Showing how to extend new styles based on existing rich text components.
    • Image - Showing how to extend a new node and render it.
    • More examples. rich text plugins
  • Extends a custom shortcut key.
    • BUIS - Showing how to make text bold/underline/italic/strikethrough through shortcut keys
    • Paste HTML - Showing how to handle pasted styles through shortcut keys
    • More examples. internal key event handlers

Glossary

We are working on more detailed instructions, for now please refer to the API documentation.

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated. Please look at CONTRIBUTING.md for details.