Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

feat: add global drag and drop function to the editor #48

Merged
merged 28 commits into from Sep 26, 2023

Conversation

LIlGG
Copy link
Contributor

@LIlGG LIlGG commented Sep 14, 2023

What type of PR is this?

/kind feature

What this PR does / why we need it:

为编辑器中所有元素增加了拖拽功能,将可以拖拽任意元素的顺序。
默认情况下,拖拽功能会被禁用,只有当扩展实现了 getDraggable 时才会使元素可拖拽。

TODO:

  • 实现基本拖拽功能
  • 根据不同的扩展,调整拖拽按钮出现的位置以及其动作
  • 拖拽功能扩展文档

How to test it?

Which issue(s) this PR fixes:

Fixes #46

Does this PR introduce a user-facing change?

为编辑器所有元素增加可拖拽功能。

@vercel
Copy link

vercel bot commented Sep 14, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
richtext-editor ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 26, 2023 2:39am

@f2c-ci-robot f2c-ci-robot bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Sep 14, 2023
@LIlGG
Copy link
Contributor Author

LIlGG commented Sep 18, 2023

/retitle feat: add global drag and drop function to the editor

@f2c-ci-robot f2c-ci-robot bot changed the title WIP: feat: add global drag and drop function to the editor feat: add global drag and drop function to the editor Sep 18, 2023
@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 Sep 18, 2023
@f2c-ci-robot f2c-ci-robot bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 22, 2023
Copy link
Contributor

@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 Sep 25, 2023
@JohnNiang
Copy link
Contributor

拖拽过程中的样式能否再优化一下边距,目前似乎是无边距的,请看下面的截图:

image

@LIlGG
Copy link
Contributor Author

LIlGG commented Sep 26, 2023

拖拽过程中的样式能否再优化一下边距,目前似乎是无边距的,请看下面的截图:

image

这是由于 p 标签本身不具有 padding 属性导致的,拖拽图使用的是被拖拽元素的实际样式。而例如 table 就具有边框,简单来说,这是由于扩展样式本身导致的。

image

Copy link
Contributor

@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.

/lgtm

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

f2c-ci-robot bot commented Sep 26, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JohnNiang

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 3d03962 into halo-sigs:main Sep 26, 2023
3 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. 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