Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

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

Vanessaa30f229ade52
diff --git a/app/src/protyle/render/av/cell.ts b/app/src/protyle/render/av/cell.ts
index 3c6d9c3905..78b3dc0b3e 100644
--- a/app/src/protyle/render/av/cell.ts
+++ b/app/src/protyle/render/av/cell.ts
@@ -108,7 +108,7 @@ export const genCellValueByElement = (colType: TAVCol, cellElement: HTMLElement)
const contents: IAVCellValue[] = [];
Array.from(cellElement.querySelectorAll(".av__cell--relation")).forEach((relationItem: HTMLElement) => {
const item = relationItem.querySelector(".av__celltext") as HTMLElement;
- blockIDs.push(item.dataset.rowId);
+ blockIDs.push(relationItem.dataset.rowId);
contents.push({
isDetached: !item.classList.contains("av__celltext--ref"),
block: {
@@ -1102,7 +1102,7 @@ export const getPositionByCellElement = (cellElement: HTMLElement) => {
export const dragFillCellsValue = (protyle: IProtyle, nodeElement: HTMLElement, originData: {
[key: string]: IAVCellValue[]
-}, originCellIds: string[]) => {
+}, originCellIds: string[], activeElement: Element) => {
nodeElement.querySelector(".av__drag-fill")?.remove();
const newData: { [key: string]: Array<IAVCellValue & { colId?: string, element?: HTMLElement }> } = {};
nodeElement.querySelectorAll(".av__cell--active").forEach((item: HTMLElement) => {
@@ -1128,6 +1128,7 @@ export const dragFillCellsValue = (protyle: IProtyle, nodeElement: HTMLElement,
const undoOperations: IOperation[] = [];
const avID = nodeElement.dataset.avId;
const originKeys = Object.keys(originData);
+ const showIcon = activeElement.querySelector(".b3-menu__avemoji") ? true : false;
Object.keys(newData).forEach((rowID, index) => {
newData[rowID].forEach((item, cellIndex) => {
if (["rollup", "template", "created", "updated"].includes(item.type) ||
@@ -1150,8 +1151,7 @@ export const dragFillCellsValue = (protyle: IProtyle, nodeElement: HTMLElement,
rowID,
data
});
- const iconElement = item.element.querySelector(".b3-menu__avemoji");
- item.element.innerHTML = renderCell(data, 0, iconElement ? !iconElement.classList.contains("fn__none") : false);
+ item.element.innerHTML = renderCell(data, 0, showIcon);
renderCellAttr(item.element, data);
delete item.colId;
delete item.element;
diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts
index 35747db211..50770d415e 100644
--- a/app/src/protyle/wysiwyg/index.ts
+++ b/app/src/protyle/wysiwyg/index.ts
@@ -728,7 +728,7 @@ export class WYSIWYG {
return;
}
const originData: { [key: string]: IAVCellValue[] } = {};
- let lastOriginCellElement;
+ let lastOriginCellElement: HTMLElement;
const originCellIds: string[] = [];
nodeElement.querySelectorAll(".av__cell--active").forEach((item: HTMLElement) => {
const rowElement = hasClosestByClassName(item, "av__row");
@@ -783,7 +783,7 @@ export class WYSIWYG {
documentSelf.onselectstart = null;
documentSelf.onselect = null;
if (lastCellElement) {
- dragFillCellsValue(protyle, nodeElement, originData, originCellIds);
+ dragFillCellsValue(protyle, nodeElement, originData, originCellIds, lastOriginCellElement);
const allActiveCellsElement = nodeElement.querySelectorAll(".av__cell--active");
addDragFill(allActiveCellsElement[allActiveCellsElement.length - 1]);
}