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

块编辑器 drag handle 支持点击出现下拉菜单 #160

Open
phoouze opened this issue Mar 10, 2025 · 1 comment · May be fixed by #163
Open

块编辑器 drag handle 支持点击出现下拉菜单 #160

phoouze opened this issue Mar 10, 2025 · 1 comment · May be fixed by #163
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@phoouze
Copy link
Contributor

phoouze commented Mar 10, 2025

需求

当前项目中的块编辑器 drag handle 只起到了拖动的作用,现需要拓展其能力以支持点击弹出出现下拉菜单进行更进一步的操作:

  1. 删除当前块;
  2. 在当前块下方插入新的块。

呈现效果大致如下图:
Image

开发说明

drag handle 的代码在 src/shared/components/control/block-editor/DragHandle.js,「删除当前块」和「在当前块下方插入新的块」的逻辑已经实现(注释掉的代码),只需:

  1. 增加点击 drag handle 出现下拉菜单的交互;
  2. 点击下拉菜单的菜单项分别调用已实现的块操作逻辑。

⚠️ BlockEditor-dragHandle 是自定义 drag handle 的标识,不能去掉。

调试功能需在本地启动服务后访问 http://localhost:3000/demo,测试数据是存在 session storage 里的,需要自己先操作加一些块。

@phoouze phoouze closed this as completed Mar 10, 2025
@openbuildxyz openbuildxyz deleted a comment from phoouze Mar 11, 2025
@openbuildxyz openbuildxyz deleted a comment from Debbl Mar 11, 2025
@ourai ourai changed the title 支持 opengraph 块编辑器 drag handle 可点击出现下拉菜单 Mar 11, 2025
@ourai ourai changed the title 块编辑器 drag handle 可点击出现下拉菜单 块编辑器 drag handle 支持点击出现下拉菜单 Mar 11, 2025
@ourai ourai added enhancement New feature or request help wanted Extra attention is needed labels Mar 11, 2025
@ourai ourai reopened this Mar 11, 2025
@Debbl
Copy link
Contributor

Debbl commented Mar 11, 2025

申请,本周完成

@ourai ourai added this to the 2025W11 milestone Mar 11, 2025
@ourai ourai removed the help wanted Extra attention is needed label Mar 11, 2025
@ourai ourai moved this from Todo to In Progress in OpenBuild Official Website Mar 11, 2025
@Debbl Debbl linked a pull request Mar 12, 2025 that will close this issue
@ourai ourai moved this from In Progress to Done in OpenBuild Official Website Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants