appflowy-editor icon indicating copy to clipboard operation
appflowy-editor copied to clipboard

feat: enable drag-and-drop functionality for text in the editor

Open Jayaprakash-dev opened this issue 1 year ago • 1 comments

I made this PR after coming across the issue Drag & drop content #3980. It restricts dragging and dropping block components, allowing only the movement of plain text.

This feature allows users to select text and drag it to a preferred location within the editor. The implementation ensures that only the plain text of the selection is copied, without including the node delta or any of node data associated with the selected text. Instead, it 'adapts to the node' it is going to be placed in.

https://github.com/AppFlowy-IO/appflowy-editor/assets/68953739/362de205-1b51-49d9-b3ec-325f3ffe4540

Jayaprakash-dev avatar Jan 23 '24 23:01 Jayaprakash-dev

Codecov Report

Attention: Patch coverage is 46.86567% with 178 lines in your changes missing coverage. Please review.

Project coverage is 75.70%. Comparing base (3cd5602) to head (cde0f60). Report is 95 commits behind head on main.

Files Patch % Lines
...t/service/selection/desktop_selection_service.dart 25.38% 97 Missing :warning:
...ib/src/render/selection/dashed_cursor_painter.dart 0.00% 21 Missing :warning:
lib/src/editor_state.dart 77.77% 8 Missing :warning:
...block_component/bulleted_list_block_component.dart 61.11% 7 Missing :warning:
...ading_block_component/heading_block_component.dart 61.11% 7 Missing :warning:
...block_component/numbered_list_block_component.dart 61.11% 7 Missing :warning:
...aph_block_component/paragraph_block_component.dart 50.00% 7 Missing :warning:
...t/quote_block_component/quote_block_component.dart 61.11% 7 Missing :warning:
...ist_block_component/todo_list_block_component.dart 61.11% 7 Missing :warning:
...base_component/selection/block_selection_area.dart 71.42% 6 Missing :warning:
... and 3 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #685      +/-   ##
==========================================
- Coverage   76.46%   75.70%   -0.76%     
==========================================
  Files         295      296       +1     
  Lines       13094    13419     +325     
==========================================
+ Hits        10012    10159     +147     
- Misses       3082     3260     +178     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Jan 24 '24 20:01 codecov[bot]