This commit is contained in:
Vanessa 2024-04-19 11:20:11 +08:00
parent 6684c77120
commit 2008dcaff2
7 changed files with 18 additions and 24 deletions

View file

@ -204,5 +204,5 @@ export const getLangByType = (type: string) => {
lang = window.siyuan.languages.blockEmbed;
break;
}
return lang
}
return lang;
};

View file

@ -21,12 +21,6 @@ import {hintRef} from "../../hint/extend";
import {focusByRange} from "../../util/selection";
import {showMessage} from "../../../dialog/message";
import {previewImage} from "../../preview/image";
import {pathPosix} from "../../../util/pathName";
import {Constants} from "../../../constants";
/// #if !MOBILE
import {openAsset, openBy} from "../../../editor/util";
/// #endif
import {getSearch} from "../../../util/functions";
import {unicode2Emoji} from "../../../emoji";
import {selectRow} from "./row";
import * as dayjs from "dayjs";

View file

@ -215,8 +215,8 @@ class="fn__flex-1 fn__flex${["url", "text", "number", "email", "phone", "block"]
const targetElement = element.querySelector(".dragover__bottom, .dragover__top") as HTMLElement;
if (targetElement && dragBlockElement) {
const isBottom = targetElement.classList.contains("dragover__bottom");
const previousID = isBottom ? targetElement.dataset.colId : targetElement.previousElementSibling?.getAttribute("data-col-id")
const undoPreviousID = window.siyuan.dragElement.previousElementSibling?.getAttribute("data-col-id")
const previousID = isBottom ? targetElement.dataset.colId : targetElement.previousElementSibling?.getAttribute("data-col-id");
const undoPreviousID = window.siyuan.dragElement.previousElementSibling?.getAttribute("data-col-id");
if (previousID !== undoPreviousID && previousID !== window.siyuan.dragElement.dataset.colId) {
transaction(protyle, [{
action: "sortAttrViewCol",

View file

@ -793,7 +793,7 @@ export const showColMenu = (protyle: IProtyle, blockElement: Element, cellElemen
click() {
const addMenu = addCol(protyle, blockElement, cellElement.previousElementSibling?.getAttribute("data-col-id") || "");
if (!blockElement.contains(cellElement)) {
cellElement = blockElement.querySelector(`.av__row--header .av__cell--header[data-col-id="${colId}"]`)
cellElement = blockElement.querySelector(`.av__row--header .av__cell--header[data-col-id="${colId}"]`);
}
const addRect = cellElement.getBoundingClientRect();
addMenu.open({
@ -809,7 +809,7 @@ export const showColMenu = (protyle: IProtyle, blockElement: Element, cellElemen
click() {
const addMenu = addCol(protyle, blockElement, colId);
if (!blockElement.contains(cellElement)) {
cellElement = blockElement.querySelector(`.av__row--header .av__cell--header[data-col-id="${colId}"]`)
cellElement = blockElement.querySelector(`.av__row--header .av__cell--header[data-col-id="${colId}"]`);
}
const addRect = cellElement.getBoundingClientRect();
addMenu.open({

View file

@ -390,7 +390,7 @@ export const openMenuPanel = (options: {
}
if (targetElement.getAttribute("data-type") === "editCol") {
const previousID = (targetElement.classList.contains("dragover__top") ? targetElement.previousElementSibling?.getAttribute("data-id") : targetElement.getAttribute("data-id")) || ""
const previousID = (targetElement.classList.contains("dragover__top") ? targetElement.previousElementSibling?.getAttribute("data-id") : targetElement.getAttribute("data-id")) || "";
const undoPreviousID = sourceElement.previousElementSibling?.getAttribute("data-id") || "";
if (previousID !== undoPreviousID && previousID !== sourceId) {
transaction(options.protyle, [{

View file

@ -34,13 +34,13 @@ const updateCol = (options: {
}
colData.rollup = {
relationKeyID: itemElement.dataset.colId
}
const goSearchRollupTargetElement = options.target.nextElementSibling as HTMLElement
};
const goSearchRollupTargetElement = options.target.nextElementSibling as HTMLElement;
goSearchRollupTargetElement.querySelector(".b3-menu__accelerator").textContent = "";
goSearchRollupTargetElement.setAttribute("data-av-id", itemElement.dataset.targetAvId);
const goSearchRollupCalcElement = goSearchRollupTargetElement.nextElementSibling as HTMLElement;
goSearchRollupCalcElement.removeAttribute("data-col-type")
goSearchRollupCalcElement.removeAttribute("data-calc")
goSearchRollupCalcElement.removeAttribute("data-col-type");
goSearchRollupCalcElement.removeAttribute("data-calc");
goSearchRollupCalcElement.querySelector(".b3-menu__accelerator").textContent = window.siyuan.languages.original;
} else {
if (itemElement.dataset.colId === colData.rollup?.keyID) {
@ -49,7 +49,7 @@ const updateCol = (options: {
colData.rollup.keyID = itemElement.dataset.colId;
delete colData.rollup.calc;
const goSearchRollupCalcElement = options.target.nextElementSibling as HTMLElement;
goSearchRollupCalcElement.removeAttribute("data-calc")
goSearchRollupCalcElement.removeAttribute("data-calc");
goSearchRollupCalcElement.setAttribute("data-col-type", itemElement.dataset.colType);
goSearchRollupCalcElement.querySelector(".b3-menu__accelerator").textContent = window.siyuan.languages.original;
}

View file

@ -738,8 +738,8 @@ export class WYSIWYG {
let startFirstElement: Element;
let endLastElement: Element;
this.element.querySelectorAll("iframe").forEach(item => {
item.style.pointerEvents = "none"
})
item.style.pointerEvents = "none";
});
documentSelf.onmousemove = (moveEvent: MouseEvent) => {
const moveTarget = moveEvent.target as HTMLElement;
// table cell select
@ -907,10 +907,10 @@ export class WYSIWYG {
let currentElement: Element | boolean = firstBlockElement;
if (currentElement) {
// 从下网上选遇到嵌入块时,选中整个嵌入块
const embedElement = hasClosestByAttribute(currentElement, "data-type", "NodeBlockQueryEmbed")
// 从下往上划选遇到嵌入块时,选中整个嵌入块
const embedElement = hasClosestByAttribute(currentElement, "data-type", "NodeBlockQueryEmbed");
if (embedElement) {
currentElement = embedElement
currentElement = embedElement;
}
}
@ -985,7 +985,7 @@ export class WYSIWYG {
endLastElement = undefined;
this.element.querySelectorAll("iframe").forEach(item => {
item.style.pointerEvents = "";
})
});
protyle.selectElement.classList.add("fn__none");
protyle.selectElement.removeAttribute("style");
if (!protyle.disabled && tableBlockElement) {