From 4ccdd38de0f2e901372f829743f9f7803d457efb Mon Sep 17 00:00:00 2001 From: Vanessa Date: Mon, 28 Jul 2025 10:22:40 +0800 Subject: [PATCH] :art: https://github.com/siyuan-note/siyuan/issues/10964 --- app/src/protyle/util/editorCommonEvent.ts | 12 ++++++++++++ app/src/types/index.d.ts | 3 ++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/app/src/protyle/util/editorCommonEvent.ts b/app/src/protyle/util/editorCommonEvent.ts index 0f22c20b6..9e031618f 100644 --- a/app/src/protyle/util/editorCommonEvent.ts +++ b/app/src/protyle/util/editorCommonEvent.ts @@ -1083,14 +1083,18 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => { const doOperations: IOperation[] = []; const undoOperations: IOperation[] = []; const undoPreviousId = blockElement.querySelector(`.av__row[data-id="${selectedIds[0]}"]`).previousElementSibling.getAttribute("data-id") || ""; + const targetGroupID = targetElement.parentElement.getAttribute("data-group-id"); selectedIds.reverse().forEach(item => { if (previousID !== item && undoPreviousId !== previousID) { + const groupID = blockElement.querySelector(`.av__row[data-id="${selectedIds[0]}"]`).parentElement.getAttribute("data-group-id"); doOperations.push({ action: "sortAttrViewRow", avID, previousID, id: item, blockID: blockElement.dataset.nodeId, + groupID, + targetGroupID, }); undoOperations.push({ action: "sortAttrViewRow", @@ -1098,6 +1102,8 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => { previousID: undoPreviousId, id: item, blockID: blockElement.dataset.nodeId, + groupID: targetGroupID, + targetGroupID: groupID, }); } }); @@ -1144,14 +1150,18 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => { const doOperations: IOperation[] = []; const undoOperations: IOperation[] = []; const undoPreviousId = blockElement.querySelector(`.av__gallery-item[data-id="${selectedIds[0]}"]`).previousElementSibling?.getAttribute("data-id") || ""; + const targetGroupID = targetElement.parentElement.getAttribute("data-group-id"); selectedIds.reverse().forEach(item => { if (previousID !== item && undoPreviousId !== previousID) { + const groupID = blockElement.querySelector(`.av__row[data-id="${selectedIds[0]}"]`).parentElement.getAttribute("data-group-id"); doOperations.push({ action: "sortAttrViewRow", avID, previousID, id: item, blockID: blockElement.dataset.nodeId, + groupID, + targetGroupID, }); undoOperations.push({ action: "sortAttrViewRow", @@ -1159,6 +1169,8 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => { previousID: undoPreviousId, id: item, blockID: blockElement.dataset.nodeId, + groupID: targetGroupID, + targetGroupID: groupID, }); } }); diff --git a/app/src/types/index.d.ts b/app/src/types/index.d.ts index f23578060..fdaaed48f 100644 --- a/app/src/types/index.d.ts +++ b/app/src/types/index.d.ts @@ -552,7 +552,8 @@ interface IOperation { blockIDs?: string[] // add/removeFlashcards 专享 removeDest?: boolean // removeAttrViewCol 专享 layout?: string // addAttrViewView 专享 - groupID?: string // insertAttrViewBlock 专享 + groupID?: string // insertAttrViewBlock, sortAttrViewRow 专享 + targetGroupID?: string // sortAttrViewRow 专享 } interface IOperationSrcs {