diff --git a/app/src/block/util.ts b/app/src/block/util.ts index c543c5001..9977e273a 100644 --- a/app/src/block/util.ts +++ b/app/src/block/util.ts @@ -204,5 +204,5 @@ export const getLangByType = (type: string) => { lang = window.siyuan.languages.blockEmbed; break; } - return lang -} + return lang; +}; diff --git a/app/src/protyle/render/av/action.ts b/app/src/protyle/render/av/action.ts index 6e5450368..a692b0255 100644 --- a/app/src/protyle/render/av/action.ts +++ b/app/src/protyle/render/av/action.ts @@ -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"; diff --git a/app/src/protyle/render/av/blockAttr.ts b/app/src/protyle/render/av/blockAttr.ts index 18dd64270..261415930 100644 --- a/app/src/protyle/render/av/blockAttr.ts +++ b/app/src/protyle/render/av/blockAttr.ts @@ -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", diff --git a/app/src/protyle/render/av/col.ts b/app/src/protyle/render/av/col.ts index e94af8b77..16b836475 100644 --- a/app/src/protyle/render/av/col.ts +++ b/app/src/protyle/render/av/col.ts @@ -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({ diff --git a/app/src/protyle/render/av/openMenuPanel.ts b/app/src/protyle/render/av/openMenuPanel.ts index bed92f916..84f1c36c4 100644 --- a/app/src/protyle/render/av/openMenuPanel.ts +++ b/app/src/protyle/render/av/openMenuPanel.ts @@ -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, [{ diff --git a/app/src/protyle/render/av/rollup.ts b/app/src/protyle/render/av/rollup.ts index 58fc88fa4..a16040ef5 100644 --- a/app/src/protyle/render/av/rollup.ts +++ b/app/src/protyle/render/av/rollup.ts @@ -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; } diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts index 9b37b486a..374b06f6d 100644 --- a/app/src/protyle/wysiwyg/index.ts +++ b/app/src/protyle/wysiwyg/index.ts @@ -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) {