Vanessa 2025-05-15 22:53:36 +08:00
parent b66c76d83d
commit cbbd8e831d
4 changed files with 38 additions and 5636 deletions

5636
app/pnpm-lock.yaml generated

File diff suppressed because it is too large Load diff

View file

@ -18,6 +18,7 @@ import {genCellValueByElement, getTypeByCellElement} from "./cell";
import {writeText} from "../../util/compatibility"; import {writeText} from "../../util/compatibility";
import {escapeAttr} from "../../../util/escape"; import {escapeAttr} from "../../../util/escape";
import {renameAsset} from "../../../editor/rename"; import {renameAsset} from "../../../editor/rename";
import * as dayjs from "dayjs";
export const bindAssetEvent = (options: { export const bindAssetEvent = (options: {
protyle: IProtyle, protyle: IProtyle,
@ -157,6 +158,11 @@ export const updateAssetCell = (options: {
updateAttrViewCellAnimation(item, cellValue); updateAttrViewCellAnimation(item, cellValue);
} }
}); });
cellDoOperations.push({
action: "doUpdateUpdated",
id: options.blockElement.getAttribute("data-node-id"),
data: dayjs().format("YYYYMMDDHHmmss"),
});
transaction(options.protyle, cellDoOperations, cellUndoOperations); transaction(options.protyle, cellDoOperations, cellUndoOperations);
const menuElement = document.querySelector(".av__panel > .b3-menu") as HTMLElement; const menuElement = document.querySelector(".av__panel > .b3-menu") as HTMLElement;
if (menuElement) { if (menuElement) {

View file

@ -154,6 +154,10 @@ export const updateRelation = (options: {
isTwoWay: (options.avElement.querySelector(".b3-switch") as HTMLInputElement).checked, isTwoWay: (options.avElement.querySelector(".b3-switch") as HTMLInputElement).checked,
name: inputElement.value, name: inputElement.value,
format: colNewName format: colNewName
}, {
action: "doUpdateUpdated",
id: options.blockElement.getAttribute("data-node-id"),
data: dayjs().format("YYYYMMDDHHmmss"),
}], [{ }], [{
action: "updateAttrViewColRelation", action: "updateAttrViewColRelation",
avID: options.avID, avID: options.avID,

View file

@ -8,6 +8,7 @@ import {updateAttrViewCellAnimation} from "./action";
import {genAVValueHTML} from "./blockAttr"; import {genAVValueHTML} from "./blockAttr";
import {escapeAriaLabel, escapeAttr, escapeHtml} from "../../../util/escape"; import {escapeAriaLabel, escapeAttr, escapeHtml} from "../../../util/escape";
import {genCellValueByElement, getTypeByCellElement} from "./cell"; import {genCellValueByElement, getTypeByCellElement} from "./cell";
import * as dayjs from "dayjs";
let cellValues: IAVCellValue[]; let cellValues: IAVCellValue[];
@ -119,6 +120,11 @@ export const removeCellOption = (protyle: IProtyle, cellElements: HTMLElement[],
updateAttrViewCellAnimation(item, cellValue); updateAttrViewCellAnimation(item, cellValue);
} }
}); });
doOperations.push({
action: "doUpdateUpdated",
id: blockElement.getAttribute("data-node-id"),
data: dayjs().format("YYYYMMDDHHmmss"),
});
transaction(protyle, doOperations, undoOperations); transaction(protyle, doOperations, undoOperations);
Array.from(document.querySelectorAll(".av__panel .b3-menu__item")).find((item: HTMLElement) => { Array.from(document.querySelectorAll(".av__panel .b3-menu__item")).find((item: HTMLElement) => {
if (item.dataset.name === target.dataset.content) { if (item.dataset.name === target.dataset.content) {
@ -154,6 +160,10 @@ export const setColOption = (protyle: IProtyle, data: IAV, target: HTMLElement,
newName: inputElement.value, newName: inputElement.value,
newDesc: descElement.value newDesc: descElement.value
}, },
}, {
action: "doUpdateUpdated",
id: blockID,
data: dayjs().format("YYYYMMDDHHmmss"),
}], [{ }], [{
action: "updateAttrViewColOption", action: "updateAttrViewColOption",
id: colId, id: colId,
@ -286,6 +296,10 @@ export const setColOption = (protyle: IProtyle, data: IAV, target: HTMLElement,
id: colId, id: colId,
avID: data.id, avID: data.id,
data: newName, data: newName,
}, {
action: "doUpdateUpdated",
id: blockID,
data: dayjs().format("YYYYMMDDHHmmss"),
}], [{ }], [{
action: "updateAttrViewColOptions", action: "updateAttrViewColOptions",
id: colId, id: colId,
@ -359,6 +373,10 @@ export const setColOption = (protyle: IProtyle, data: IAV, target: HTMLElement,
newColor, newColor,
newDesc: descElement.value newDesc: descElement.value
}, },
}, {
action: "doUpdateUpdated",
id: blockID,
data: dayjs().format("YYYYMMDDHHmmss"),
}], [{ }], [{
action: "updateAttrViewColOption", action: "updateAttrViewColOption",
id: colId, id: colId,
@ -579,6 +597,11 @@ export const addColOptionOrCell = (protyle: IProtyle, data: IAV, cellElements: H
avID: data.id, avID: data.id,
data: colData.options data: colData.options
}); });
cellDoOperations.push({
action: "doUpdateUpdated",
id: blockElement.getAttribute("data-node-id"),
data: dayjs().format("YYYYMMDDHHmmss"),
});
transaction(protyle, cellDoOperations, [{ transaction(protyle, cellDoOperations, [{
action: "removeAttrViewColOption", action: "removeAttrViewColOption",
id: colId, id: colId,
@ -586,6 +609,11 @@ export const addColOptionOrCell = (protyle: IProtyle, data: IAV, cellElements: H
data: currentElement.dataset.name, data: currentElement.dataset.name,
}]); }]);
} else { } else {
cellDoOperations.push({
action: "doUpdateUpdated",
id: blockElement.getAttribute("data-node-id"),
data: dayjs().format("YYYYMMDDHHmmss"),
});
transaction(protyle, cellDoOperations, cellUndoOperations); transaction(protyle, cellDoOperations, cellUndoOperations);
} }
if (colData.type === "select") { if (colData.type === "select") {