Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: range selection feature to default editor #6117

Merged
merged 3 commits into from
Jun 26, 2024

Conversation

LIlGG
Copy link
Member

@LIlGG LIlGG commented Jun 21, 2024

What type of PR is this?

/kind feature
/area editor
/milestone 2.17.x

What this PR does / why we need it:

为默认编辑器添加 RangeSelection 选择器。

image

它的功能基本与 TextSelection 相反,例如:

  1. TextSelection 支持光标展示,RangeSelection 不允许空内容,即它并不支持光标。
  2. TextSelection 会抛弃被选择的 Node 节点部分偏移量,而 RangeSelection 会扩展偏移量至 Node 节点结束。
  3. TextSelection 支持 Text 而 RangeSelection 支持 Node 节点。

RangeSelection 可以用于范围选中块节点并进行操作,可用于全选内容并进行删除操作。

How to test it?

测试使用点击,拖拽,释放鼠标的操作,能否选中某些节点。
测试删除选中的节点。

Which issue(s) this PR fixes:

Fixes #5194

Does this PR introduce a user-facing change?

为默认编辑器添加 RangeSelection 选择器

@f2c-ci-robot f2c-ci-robot bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Jun 21, 2024
@f2c-ci-robot f2c-ci-robot bot added this to the 2.17.x milestone Jun 21, 2024
@f2c-ci-robot f2c-ci-robot bot added the area/editor Issues or PRs related to the Editor label Jun 21, 2024
@f2c-ci-robot f2c-ci-robot bot requested review from guqing and wzrove June 21, 2024 10:05
@LIlGG LIlGG marked this pull request as ready for review June 24, 2024 10:55
@f2c-ci-robot f2c-ci-robot bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 24, 2024
@f2c-ci-robot f2c-ci-robot bot requested review from QuentinHsu and wan92hen June 24, 2024 10:55
Copy link

codecov bot commented Jun 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 54.68%. Comparing base (5fdf6c0) to head (75981b4).
Report is 264 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #6117      +/-   ##
============================================
- Coverage     56.91%   54.68%   -2.23%     
- Complexity     3319     3427     +108     
============================================
  Files           587      629      +42     
  Lines         18968    21209    +2241     
  Branches       1401     1482      +81     
============================================
+ Hits          10795    11599     +804     
- Misses         7594     9019    +1425     
- Partials        579      591      +12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@JohnNiang JohnNiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@f2c-ci-robot f2c-ci-robot bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 26, 2024
Copy link
Member

@ruibaby ruibaby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@f2c-ci-robot f2c-ci-robot bot added the lgtm Indicates that a PR is ready to be merged. label Jun 26, 2024
Copy link

f2c-ci-robot bot commented Jun 26, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JohnNiang, ruibaby

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@f2c-ci-robot f2c-ci-robot bot merged commit ba2987b into halo-dev:main Jun 26, 2024
7 checks passed
@ruibaby ruibaby modified the milestones: 2.17.x, 2.17.0 Jun 26, 2024
@LIlGG LIlGG deleted the feat/range-selection branch June 26, 2024 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/editor Issues or PRs related to the Editor kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

默认富文本编辑器中全选表格后,按退格键后无法删除完全
3 participants