diff --git a/app/src/assets/scss/business/_av.scss b/app/src/assets/scss/business/_av.scss index eb74e61ba6e..2ab5b4e2ea0 100644 --- a/app/src/assets/scss/business/_av.scss +++ b/app/src/assets/scss/business/_av.scss @@ -207,6 +207,12 @@ top: 8px; } + &--select { + background-color: var(--b3-theme-primary-lightest); + box-shadow: 2px 2px 0 var(--b3-theme-primary-lighter) inset, -2px -2px 0px var(--b3-theme-primary-lighter) inset; + border-radius: var(--b3-border-radius); + } + .block__icon { position: absolute; right: 5px; diff --git a/app/src/menus/protyle.ts b/app/src/menus/protyle.ts index 9933407381c..7fd31b31811 100644 --- a/app/src/menus/protyle.ts +++ b/app/src/menus/protyle.ts @@ -45,6 +45,7 @@ import {hideElements} from "../protyle/ui/hideElements"; import {emitOpenMenu} from "../plugin/EventBus"; import {openMobileFileById} from "../mobile/editor"; import {openBacklink, openGraph} from "../layout/dock/util"; +import {updateHeader} from "../protyle/render/av/col"; export const fileAnnotationRefMenu = (protyle: IProtyle, refElement: HTMLElement) => { const nodeElement = hasClosestBlock(refElement); @@ -1663,8 +1664,11 @@ export const setFold = (protyle: IProtyle, nodeElement: Element, isOpen?: boolea focusBlock(nodeElement, undefined, false); } } - nodeElement.querySelectorAll(".img--select").forEach((item) => { - item.classList.remove("img--select"); + nodeElement.querySelectorAll(".img--select, .av__cell--select, .av__row--select").forEach((item:HTMLElement) => { + if (item.classList.contains("av__row--select")) { + updateHeader(item); + } + item.classList.remove("img--select", "av__cell--select", "av__row--select"); }); } const id = nodeElement.getAttribute("data-node-id"); diff --git a/app/src/protyle/render/av/cell.ts b/app/src/protyle/render/av/cell.ts index 0db8ddcb4f1..468a3ff26d8 100644 --- a/app/src/protyle/render/av/cell.ts +++ b/app/src/protyle/render/av/cell.ts @@ -490,6 +490,7 @@ const updateCellValue = (protyle: IProtyle, type: TAVCol, cellElements: HTMLElem if (doOperations.length > 0) { transaction(protyle, doOperations, undoOperations); } + cellElements[0].classList.add("av__cell--select"); setTimeout(() => { avMaskElement.remove(); }); diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts index d3e2967b933..1ab5979ae35 100644 --- a/app/src/protyle/wysiwyg/index.ts +++ b/app/src/protyle/wysiwyg/index.ts @@ -76,6 +76,7 @@ import {removeSearchMark} from "../toolbar/util"; import {activeBlur, hideKeyboardToolbar} from "../../mobile/util/keyboardToolbar"; import {commonClick} from "./commonClick"; import {avClick, avContextmenu, updateAVName} from "../render/av/action"; +import {updateHeader} from "../render/av/col"; export class WYSIWYG { public lastHTMLs: { [key: string]: string } = {}; @@ -185,10 +186,13 @@ export class WYSIWYG { private setEmptyOutline(protyle: IProtyle, element: HTMLElement) { // 图片移除选择状态应放在前面,否则 https://github.com/siyuan-note/siyuan/issues/4173 - const selectImgElement = protyle.wysiwyg.element.querySelector(".img--select"); - if (selectImgElement) { - selectImgElement.classList.remove("img--select"); - } + protyle.wysiwyg.element.querySelectorAll(".img--select, .av__cell--select, .av__row--select").forEach((item: HTMLElement) => { + if (item.classList.contains("av__row--select")) { + updateHeader(item); + } + item.classList.remove("img--select", "av__cell--select", "av__row--select"); + }); + let nodeElement = element; if (!element.getAttribute("data-node-id")) { const tempElement = hasClosestBlock(element);