refactor(submit): drop the hover block-delete overlay

Hovering a quote, hidden block, code block or table showed a ✕ button in the
block's top-right corner. It read as a stray close button and is not wanted.

Removed
- installBlockActions() and the two-step select/delete flow it drove
- the block-actions markup, positioning, selected-state CSS in the iframe
  content style
- BLOCK_SELECTOR, which only the overlay used

Deleting blocks still works: removeAdjacentBlock() keeps Backspace / Delete
next to a structural block (table, pre, hr, quote, hidden block) working, and
that is covered by both code and tests.
This commit is contained in:
kate522 committed 2026-11-10 18:56:30 +08:00
1 parent 49f1212e33
commit a061ec86ce
6 files changed
+25 -288

No files matched your search

@@ -140,13 +140,13 @@ test('placeholder never becomes a DOM node in the editable body', () => {
});
test('editor chrome injected into the body does not count as content', () => {
// 真实页面上 editor-runtime 会把块删除浮层插进 body,它带 data-mce-bogus
// 但含文字(「✕ 选中此块」)。若按 body.textContent 判断,空正文永远非空,
// 占位符就永远不显示 —— 这正是「首次加载不显示」的真实原因。
// TinyMCE 会往 body 里插带 data-mce-bogus 的工具节点,其中可能含文字。
// 若按 body.textContent 判断,空正文永远非空,占位符就永远不显示 ——
// 这正是「首次加载不显示」的真实原因。
const { doc, editor } = createEditor(
'<p><br data-mce-bogus="1"></p>' +
'<div id="jio-block-actions" data-mce-bogus="all">' +
'<button type="button"><span>✕</span><span>选中此块</span></button></div>',
'<div data-mce-bogus="all">' +
'<button type="button"><span>✕</span><span>工具节点</span></button></div>',
{ placeholder: '请输入正文' }
);
const plugin = loadPlugin()[PLUGIN];