ソースを参照

:art: https://github.com/siyuan-note/siyuan/issues/11032

Vanessa 1 年間 前
コミット
cf85b7e0ed

+ 1 - 0
app/appearance/themes/daylight/theme.css

@@ -108,6 +108,7 @@
     --b3-transition: all .2s cubic-bezier(0, 0, .2, 1) 0ms;
     --b3-transition: all .2s cubic-bezier(0, 0, .2, 1) 0ms;
     --b3-width-transition: width .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-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);
     --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);

+ 1 - 0
app/appearance/themes/midnight/theme.css

@@ -108,6 +108,7 @@
     --b3-transition: all .2s cubic-bezier(0, 0, .2, 1) 0ms;
     --b3-transition: all .2s cubic-bezier(0, 0, .2, 1) 0ms;
     --b3-width-transition: width .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-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);
     --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);

+ 3 - 2
app/src/assets/scss/business/_av.scss

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

+ 1 - 1
app/src/assets/scss/protyle/_wysiwyg.scss

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

+ 8 - 3
app/src/protyle/render/av/render.ts

@@ -4,7 +4,7 @@ import {Constants} from "../../../constants";
 import {addDragFill, renderCell} from "./cell";
 import {addDragFill, renderCell} from "./cell";
 import {unicode2Emoji} from "../../../emoji";
 import {unicode2Emoji} from "../../../emoji";
 import {focusBlock} from "../../util/selection";
 import {focusBlock} from "../../util/selection";
-import {hasClosestBlock, hasClosestByClassName} from "../../util/hasClosest";
+import {hasClosestBlock, hasClosestByAttribute, hasClosestByClassName} from "../../util/hasClosest";
 import {stickyRow} from "./row";
 import {stickyRow} from "./row";
 import {getCalcValue} from "./calc";
 import {getCalcValue} from "./calc";
 import {renderAVAttribute} from "./blockAttr";
 import {renderAVAttribute} from "./blockAttr";
@@ -191,8 +191,13 @@ ${cell.color ? `color:${cell.color};` : ""}">${renderCell(cell.value, rowIndex)}
                         viewData = item;
                         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="av__header">
         <div class="fn__flex av__views${isSearching || query ? " av__views--show" : ""}">
         <div class="fn__flex av__views${isSearching || query ? " av__views--show" : ""}">
             <div class="layout-tab-bar fn__flex">
             <div class="layout-tab-bar fn__flex">

+ 1 - 1
app/src/protyle/wysiwyg/index.ts

@@ -532,7 +532,7 @@ export class WYSIWYG {
             }
             }
             // av cell select
             // av cell select
             const avCellElement = hasClosestByClassName(target, "av__cell");
             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);
                 const nodeElement = hasClosestBlock(avCellElement);
                 if (!nodeElement) {
                 if (!nodeElement) {
                     return;
                     return;