-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
feat: refactor the drag function and add support for the drag menu #7861
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
Conversation
@halo-dev/api-client
@halo-dev/components
@halo-dev/richtext-editor
@halo-dev/console-shared
@halo-dev/ui-plugin-bundler-kit
commit: |
supplement document fix type issues change icon resolve some minor bugs Perform some minor optimizations Perform some minor optimizations
6263288 to
29c4f8b
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7861 +/- ##
============================================
+ Coverage 59.55% 61.21% +1.66%
- Complexity 3812 3930 +118
============================================
Files 677 688 +11
Lines 23248 23483 +235
Branches 1500 1519 +19
============================================
+ Hits 13846 14376 +530
+ Misses 8764 8382 -382
- Partials 638 725 +87 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Replaces `parentKey` with `extendsKey` for drag menu item extension, enabling multiple extensions to target the same menu item. Updates merging logic to support AND/OR behaviors for `visible`, `isActive`, and `disabled` properties, and allows extensions to override or append child menu items. Documentation and affected extensions updated to reflect new API.
Replaces isEmpty with isBlockEmpty in EditorDragHandle and updates block insertion to use insertContentAt with paragraph and text. Refactors is-node-empty utility to add isNodeContentEmpty and isBlockEmpty, improving node emptiness checks. Exports new utility functions in index.ts.
|
已解决 |
ruibaby
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: 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 |




What type of PR is this?
/kind feature
/area ui
/area editor
What this PR does / why we need it:
重构拖拽功能, 使用 Tiptap extension-drag-handle-vue-3 代替原有的自定义方式。
并且,在此基础上,增加了添加至下一行及拖拽菜单的功能,且支持插件动态扩展拖拽菜单。
对于插件开发者,尤其是编辑器开发者来说,此 PR 有如下变更:
getDraggable方法,不再使用它,直接移除即可。getDraggableMenuItems方法,用于扩展拖拽菜单。扩展方式如下:
Does this PR introduce a user-facing change?