diff --git a/frontend/app_flowy/packages/appflowy_editor/assets/images/quote.svg b/frontend/app_flowy/packages/appflowy_editor/assets/images/quote.svg index 0f3d33f6d3..1393e71556 100644 --- a/frontend/app_flowy/packages/appflowy_editor/assets/images/quote.svg +++ b/frontend/app_flowy/packages/appflowy_editor/assets/images/quote.svg @@ -1,3 +1,3 @@ - + \ No newline at end of file diff --git a/frontend/app_flowy/packages/appflowy_editor/assets/images/selection_menu/quote.svg b/frontend/app_flowy/packages/appflowy_editor/assets/images/selection_menu/quote.svg new file mode 100644 index 0000000000..5c1cbb4a50 --- /dev/null +++ b/frontend/app_flowy/packages/appflowy_editor/assets/images/selection_menu/quote.svg @@ -0,0 +1,4 @@ + + + + diff --git a/frontend/app_flowy/packages/appflowy_editor/lib/src/render/selection_menu/selection_menu_service.dart b/frontend/app_flowy/packages/appflowy_editor/lib/src/render/selection_menu/selection_menu_service.dart index 7f4f803610..f4f2006af4 100644 --- a/frontend/app_flowy/packages/appflowy_editor/lib/src/render/selection_menu/selection_menu_service.dart +++ b/frontend/app_flowy/packages/appflowy_editor/lib/src/render/selection_menu/selection_menu_service.dart @@ -169,6 +169,14 @@ final List _defaultSelectionMenuItems = [ insertCheckboxAfterSelection(editorState); }, ), + SelectionMenuItem( + name: 'Quote', + icon: _selectionMenuIcon('quote'), + keywords: ['quote', 'refer'], + handler: (editorState, _, __) { + insertQuoteAfterSelection(editorState); + }, + ), ]; Widget _selectionMenuIcon(String name) { diff --git a/frontend/app_flowy/packages/appflowy_editor/test/render/selection_menu/selection_menu_widget_test.dart b/frontend/app_flowy/packages/appflowy_editor/test/render/selection_menu/selection_menu_widget_test.dart index 2711921352..6006fe6a7a 100644 --- a/frontend/app_flowy/packages/appflowy_editor/test/render/selection_menu/selection_menu_widget_test.dart +++ b/frontend/app_flowy/packages/appflowy_editor/test/render/selection_menu/selection_menu_widget_test.dart @@ -38,17 +38,17 @@ void main() async { await editor.pressLogicKey(LogicalKeyboardKey.keyE); expect( find.byType(SelectionMenuItemWidget, skipOffstage: false), - findsNWidgets(2), + findsNWidgets(3), ); await editor.pressLogicKey(LogicalKeyboardKey.backspace); expect( find.byType(SelectionMenuItemWidget, skipOffstage: false), - findsNWidgets(3), + findsNWidgets(4), ); await editor.pressLogicKey(LogicalKeyboardKey.keyE); expect( find.byType(SelectionMenuItemWidget, skipOffstage: false), - findsNWidgets(2), + findsNWidgets(3), ); await editor.pressLogicKey(LogicalKeyboardKey.keyX); expect( @@ -73,7 +73,7 @@ void main() async { await editor.pressLogicKey(LogicalKeyboardKey.keyE); expect( find.byType(SelectionMenuItemWidget, skipOffstage: false), - findsNWidgets(2), + findsNWidgets(3), ); await editor.pressLogicKey(LogicalKeyboardKey.escape); expect( @@ -89,7 +89,7 @@ void main() async { await editor.pressLogicKey(LogicalKeyboardKey.keyE); expect( find.byType(SelectionMenuItemWidget, skipOffstage: false), - findsNWidgets(2), + findsNWidgets(3), ); await editor.pressLogicKey(LogicalKeyboardKey.backspace); await editor.pressLogicKey(LogicalKeyboardKey.backspace);