Vanessa 2025-11-22 22:15:11 +08:00
parent 5c5dc16954
commit a0f49da336
2 changed files with 15 additions and 0 deletions

View file

@ -411,6 +411,9 @@ export const paste = async (protyle: IProtyle, event: (ClipboardEvent | DragEven
e.classList.remove("protyle-wysiwyg--select", "protyle-wysiwyg--hl"); e.classList.remove("protyle-wysiwyg--select", "protyle-wysiwyg--hl");
e.setAttribute("updated", newId.split("-")[0]); e.setAttribute("updated", newId.split("-")[0]);
e.removeAttribute("refcount"); e.removeAttribute("refcount");
e.querySelector(".protyle-attr--av")?.remove();
e.removeAttribute("custom-avs");
e.removeAttribute("av-names");
isBlock = true; isBlock = true;
}); });
if (nodeElement.classList.contains("table")) { if (nodeElement.classList.contains("table")) {

View file

@ -318,6 +318,9 @@ export const duplicateBlock = async (nodeElements: Element[], protyle: IProtyle)
tempElement.setAttribute("updated", newId.split("-")[0]); tempElement.setAttribute("updated", newId.split("-")[0]);
tempElement.removeAttribute("refcount"); tempElement.removeAttribute("refcount");
tempElement.lastElementChild.querySelector(".protyle-attr--refcount")?.remove(); tempElement.lastElementChild.querySelector(".protyle-attr--refcount")?.remove();
tempElement.lastElementChild.querySelector(".protyle-attr--av")?.remove();
tempElement.removeAttribute("custom-avs");
tempElement.removeAttribute("av-names");
tempElement.querySelectorAll("[data-node-id]").forEach(childItem => { tempElement.querySelectorAll("[data-node-id]").forEach(childItem => {
const subNewId = Lute.NewNodeID(); const subNewId = Lute.NewNodeID();
childItem.setAttribute("data-node-id", subNewId); childItem.setAttribute("data-node-id", subNewId);
@ -326,6 +329,9 @@ export const duplicateBlock = async (nodeElements: Element[], protyle: IProtyle)
childItem.setAttribute("updated", subNewId.split("-")[0]); childItem.setAttribute("updated", subNewId.split("-")[0]);
childItem.removeAttribute("refcount"); childItem.removeAttribute("refcount");
childItem.lastElementChild.querySelector(".protyle-attr--refcount")?.remove(); childItem.lastElementChild.querySelector(".protyle-attr--refcount")?.remove();
childItem.lastElementChild.querySelector(".protyle-attr--av")?.remove();
childItem.removeAttribute("custom-avs");
childItem.removeAttribute("av-names");
}); });
if (typeof starIndex === "number") { if (typeof starIndex === "number") {
const orderIndex = starIndex + index + 1; const orderIndex = starIndex + index + 1;
@ -356,11 +362,17 @@ export const duplicateBlock = async (nodeElements: Element[], protyle: IProtyle)
subItem.setAttribute("data-node-id", Lute.NewNodeID()); subItem.setAttribute("data-node-id", Lute.NewNodeID());
subItem.removeAttribute(Constants.CUSTOM_RIFF_DECKS); subItem.removeAttribute(Constants.CUSTOM_RIFF_DECKS);
subItem.removeAttribute("refcount"); subItem.removeAttribute("refcount");
subItem.lastElementChild.querySelector(".protyle-attr--av")?.remove();
subItem.removeAttribute("custom-avs");
subItem.removeAttribute("av-names");
}); });
const newChildId = Lute.NewNodeID(); const newChildId = Lute.NewNodeID();
childItem.setAttribute("data-node-id", newChildId); childItem.setAttribute("data-node-id", newChildId);
childItem.removeAttribute(Constants.CUSTOM_RIFF_DECKS); childItem.removeAttribute(Constants.CUSTOM_RIFF_DECKS);
childItem.removeAttribute("refcount"); childItem.removeAttribute("refcount");
childItem.lastElementChild.querySelector(".protyle-attr--av")?.remove();
childItem.removeAttribute("custom-avs");
childItem.removeAttribute("av-names");
doOperations.push({ doOperations.push({
context: { context: {
ignoreProcess: "true" ignoreProcess: "true"