Vanessa 2024-04-22 13:46:27 +08:00
parent 81af862457
commit cf85b7e0ed
6 changed files with 15 additions and 7 deletions

View file

@ -108,6 +108,7 @@
--b3-transition: all .2s cubic-bezier(0, 0, .2, 1) 0ms;
--b3-width-transition: width .2s cubic-bezier(0, 0, .2, 1) 0ms;
--b3-color-transition: color .2s cubic-bezier(0, 0, .2, 1) 0ms;
--b3-background-transition: background 20ms ease-in 0s;
/* 下拉菜单 */
--b3-select-background: url("data:image/svg+xml;utf8,<svg fill='rgba(95, 99, 104, .68)' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>") no-repeat right 2px center var(--b3-theme-background);

View file

@ -108,6 +108,7 @@
--b3-transition: all .2s cubic-bezier(0, 0, .2, 1) 0ms;
--b3-width-transition: width .2s cubic-bezier(0, 0, .2, 1) 0ms;
--b3-color-transition: color .2s cubic-bezier(0, 0, .2, 1) 0ms;
--b3-background-transition: background 20ms ease-in 0s;
/* 下拉菜单 */
--b3-select-background: url("data:image/svg+xml;utf8,<svg fill='rgba(154, 160, 166, .68)' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>") no-repeat right 2px center var(--b3-theme-background);

View file

@ -295,7 +295,6 @@
padding: 5px 8px;
display: flex;
align-items: center;
transition: background 20ms ease-in 0s;
overflow: inherit; // 保证列宽和顺序调整的拖拽点样式
border-right-color: transparent;
@ -324,6 +323,7 @@
margin: 0 0 0 5px;
}
}
}
.block__icon {
@ -426,7 +426,7 @@
width: 5px;
height: 100%;
right: -2.5px;
transition: background 20ms ease-in 0s;
transition: var(--b3-background-transition);
z-index: 1;
&:hover {
@ -521,6 +521,7 @@
.av__cell--active,
.av__counter {
background-color: var(--b3-av-background-hl) !important;
transition: var(--b3-background-transition);
}
}

View file

@ -459,7 +459,7 @@
&--hl,
&--hl .hljs {
transition: var(--b3-transition);
transition: var(--b3-background-transition);
background-color: var(--b3-theme-primary-lightest) !important;
}

View file

@ -4,7 +4,7 @@ import {Constants} from "../../../constants";
import {addDragFill, renderCell} from "./cell";
import {unicode2Emoji} from "../../../emoji";
import {focusBlock} from "../../util/selection";
import {hasClosestBlock, hasClosestByClassName} from "../../util/hasClosest";
import {hasClosestBlock, hasClosestByAttribute, hasClosestByClassName} from "../../util/hasClosest";
import {stickyRow} from "./row";
import {getCalcValue} from "./calc";
import {renderAVAttribute} from "./blockAttr";
@ -191,8 +191,13 @@ ${cell.color ? `color:${cell.color};` : ""}">${renderCell(cell.value, rowIndex)}
viewData = item;
}
});
e.firstElementChild.outerHTML = `<div class="av__container" style="--av-background:${e.style.backgroundColor || "var(--b3-theme-background)"}">
let avBackground = '--av-background:var(--b3-theme-background)'
if (e.style.backgroundColor) {
avBackground = avBackground + e.style.backgroundColor
} else if (hasClosestByAttribute(e, "data-type", "NodeBlockQueryEmbed")) {
avBackground = avBackground + 'var(--b3-theme-surface)'
}
e.firstElementChild.outerHTML = `<div class="av__container" style="${avBackground}">
<div class="av__header">
<div class="fn__flex av__views${isSearching || query ? " av__views--show" : ""}">
<div class="layout-tab-bar fn__flex">

View file

@ -532,7 +532,7 @@ export class WYSIWYG {
}
// av cell select
const avCellElement = hasClosestByClassName(target, "av__cell");
if (!protyle.disabled && avCellElement && avCellElement.dataset.id) {
if (!protyle.disabled && avCellElement && avCellElement.dataset.id && !hasClosestByAttribute(avCellElement, "data-type", "NodeBlockQueryEmbed")) {
const nodeElement = hasClosestBlock(avCellElement);
if (!nodeElement) {
return;