An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: https://github.com/siyuan-note/siyuan/issues/12904
Vanessae98f0480ee4f
diff --git a/app/src/assets/scss/business/_custom.scss b/app/src/assets/scss/business/_custom.scssindex 1137f851a2..ec77167433 100644--- a/app/src/assets/scss/business/_custom.scss+++ b/app/src/assets/scss/business/_custom.scss@@ -9,7 +9,8 @@min-height: 26px;flex-wrap: wrap;- &:not(.custom-attr__avvalue--readonly):hover {+ &:not(.custom-attr__avvalue--readonly):hover,+ &--active {background-color: var(--b3-theme-surface-light);}diff --git a/app/src/protyle/render/av/blockAttr.ts b/app/src/protyle/render/av/blockAttr.tsindex cea8f5bc2d..e8f00e8c37 100644--- a/app/src/protyle/render/av/blockAttr.ts+++ b/app/src/protyle/render/av/blockAttr.ts@@ -9,8 +9,12 @@ import {transaction} from "../../wysiwyg/transaction";import {openMenuPanel} from "./openMenuPanel";import {uploadFiles} from "../../upload";import {openLink} from "../../../editor/openLink";-import {editAssetItem} from "./asset";+import {dragUpload, editAssetItem} from "./asset";import {previewImage} from "../../preview/image";+/// #if !BROWSER+import {webUtils} from "electron";+/// #endif+import {isBrowser} from "../../../util/functions";const genAVRollupHTML = (value: IAVCellValue) => {let html = "";@@ -221,9 +225,13 @@ class="fn__flex-1 fn__flex${["url", "text", "number", "email", "phone"].includesghostElement.remove();});});- element.addEventListener("drop", () => {+ element.addEventListener("drop", (event) => {counter = 0;- window.siyuan.dragElement.style.opacity = "";+ if (protyle.disabled) {+ event.preventDefault();+ event.stopPropagation();+ return;+ }const targetElement = element.querySelector(".dragover__bottom, .dragover__top") as HTMLElement;if (targetElement && dragBlockElement) {const isBottom = targetElement.classList.contains("dragover__bottom");@@ -248,12 +256,38 @@ class="fn__flex-1 fn__flex${["url", "text", "number", "email", "phone"].includes}}targetElement.classList.remove("dragover__bottom", "dragover__top");+ } else if (!window.siyuan.dragElement && event.dataTransfer.types[0] === "Files") {+ const cellElement = element.querySelector(".custom-attr__avvalue--active") as HTMLElement;+ if (cellElement) {+ if (event.dataTransfer.types[0] === "Files" && !isBrowser()) {+ const files: string[] = [];+ for (let i = 0; i < event.dataTransfer.files.length; i++) {+ files.push(webUtils.getPathForFile(event.dataTransfer.files[i]));+ }+ dragUpload(files, protyle, cellElement);+ }+ }+ }+ if (window.siyuan.dragElement) {+ window.siyuan.dragElement.style.opacity = "";+ window.siyuan.dragElement = undefined;}- window.siyuan.dragElement = null;});element.addEventListener("dragover", (event: DragEvent) => {const target = event.target as HTMLElement;- let targetElement = hasClosestByClassName(target, "av__row");+ let targetElement: HTMLElement | false;+ if (event.dataTransfer.types.includes("Files")) {+ element.querySelectorAll(".custom-attr__avvalue--active").forEach((item: HTMLElement) => {+ item.classList.remove("custom-attr__avvalue--active");+ });+ targetElement = hasClosestByClassName(target, "custom-attr__avvalue");+ if (targetElement && targetElement.getAttribute("data-type") === "mAsset") {+ targetElement.classList.add("custom-attr__avvalue--active");+ event.preventDefault();+ }+ return;+ }+ targetElement = hasClosestByClassName(target, "av__row");if (!targetElement) {targetElement = hasClosestByClassName(document.elementFromPoint(event.clientX, event.clientY - 1), "av__row");}