mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
🎨 PNPM Lint
This commit is contained in:
parent
b5a60fc1fa
commit
6f98849e9c
7 changed files with 8 additions and 12 deletions
|
|
@ -335,7 +335,7 @@ export const showPopover = async (app: App, showRef = false) => {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let refDefs: IRefDefs[];
|
let refDefs: IRefDefs[];
|
||||||
let originalRefBlockIDs: IObject
|
let originalRefBlockIDs: IObject;
|
||||||
const dataId = popoverTargetElement.getAttribute("data-id");
|
const dataId = popoverTargetElement.getAttribute("data-id");
|
||||||
if (dataId) {
|
if (dataId) {
|
||||||
// backlink/util/hint 上的弹层
|
// backlink/util/hint 上的弹层
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,5 @@
|
||||||
import {getAllModels} from "../../layout/getAll";
|
import {getAllModels} from "../../layout/getAll";
|
||||||
import {
|
import {hasClosestByAttribute, hasClosestByClassName, hasTopClosestByClassName} from "../../protyle/util/hasClosest";
|
||||||
hasClosestByAttribute,
|
|
||||||
hasClosestByClassName,
|
|
||||||
hasTopClosestByClassName
|
|
||||||
} from "../../protyle/util/hasClosest";
|
|
||||||
import {hideAllElements} from "../../protyle/ui/hideElements";
|
import {hideAllElements} from "../../protyle/ui/hideElements";
|
||||||
import {isWindow} from "../../util/functions";
|
import {isWindow} from "../../util/functions";
|
||||||
import {writeText} from "../../protyle/util/compatibility";
|
import {writeText} from "../../protyle/util/compatibility";
|
||||||
|
|
@ -19,7 +15,7 @@ export const globalClickHideMenu = (element: HTMLElement) => {
|
||||||
window.siyuan.menus.menu.remove();
|
window.siyuan.menus.menu.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
export const globalClick = (event: MouseEvent & { target: HTMLElement }) => {
|
export const globalClick = (event: MouseEvent & { target: HTMLElement }) => {
|
||||||
cancelDrag();
|
cancelDrag();
|
||||||
|
|
|
||||||
|
|
@ -19,4 +19,4 @@ export const cancelDrag = () => {
|
||||||
ghostElement.remove();
|
ghostElement.remove();
|
||||||
document.onmousemove = null;
|
document.onmousemove = null;
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
|
||||||
|
|
@ -874,7 +874,7 @@ export const openMenuPanel = (options: {
|
||||||
break;
|
break;
|
||||||
} else if (type === "updateColType") {
|
} else if (type === "updateColType") {
|
||||||
if (target.dataset.newType !== target.dataset.oldType) {
|
if (target.dataset.newType !== target.dataset.oldType) {
|
||||||
const nameElement = avPanelElement.querySelector('.b3-text-field[data-type="name"]') as HTMLInputElement
|
const nameElement = avPanelElement.querySelector('.b3-text-field[data-type="name"]') as HTMLInputElement;
|
||||||
const name = nameElement.value;
|
const name = nameElement.value;
|
||||||
let newName = name;
|
let newName = name;
|
||||||
data.view.columns.find((item: IAVColumn) => {
|
data.view.columns.find((item: IAVColumn) => {
|
||||||
|
|
|
||||||
|
|
@ -300,7 +300,7 @@ ${cell.color ? `color:${cell.color};` : ""}">${renderCell(cell.value, rowIndex)}
|
||||||
// 需等待渲染完,否则 getBoundingClientRect 错误 https://github.com/siyuan-note/siyuan/issues/13787
|
// 需等待渲染完,否则 getBoundingClientRect 错误 https://github.com/siyuan-note/siyuan/issues/13787
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
stickyRow(e, editRect, "top");
|
stickyRow(e, editRect, "top");
|
||||||
}, Constants.TIMEOUT_LOAD)
|
}, Constants.TIMEOUT_LOAD);
|
||||||
}
|
}
|
||||||
if (footerTransform) {
|
if (footerTransform) {
|
||||||
(e.querySelector(".av__row--footer") as HTMLElement).style.transform = footerTransform;
|
(e.querySelector(".av__row--footer") as HTMLElement).style.transform = footerTransform;
|
||||||
|
|
|
||||||
|
|
@ -172,7 +172,7 @@ export const pasteAsPlainText = async (protyle: IProtyle) => {
|
||||||
// Inline-level elements support pasted as plain text https://github.com/siyuan-note/siyuan/issues/8010
|
// Inline-level elements support pasted as plain text https://github.com/siyuan-note/siyuan/issues/8010
|
||||||
navigator.clipboard.readText().then(textPlain => {
|
navigator.clipboard.readText().then(textPlain => {
|
||||||
if (getSelection().rangeCount > 0) {
|
if (getSelection().rangeCount > 0) {
|
||||||
const range = getSelection().getRangeAt(0)
|
const range = getSelection().getRangeAt(0);
|
||||||
if (hasClosestByAttribute(range.startContainer, "data-type", "code") || hasClosestByClassName(range.startContainer, "hljs")) {
|
if (hasClosestByAttribute(range.startContainer, "data-type", "code") || hasClosestByClassName(range.startContainer, "hljs")) {
|
||||||
insertHTML(textPlain.replace(/\u200D```/g, "```").replace(/```/g, "\u200D```"), protyle);
|
insertHTML(textPlain.replace(/\u200D```/g, "```").replace(/```/g, "\u200D```"), protyle);
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -545,7 +545,7 @@ const removeLi = (protyle: IProtyle, blockElement: Element, range: Range, isDele
|
||||||
transaction(protyle, doOperations, undoOperations);
|
transaction(protyle, doOperations, undoOperations);
|
||||||
if (listElement.parentElement.classList.contains("sb") &&
|
if (listElement.parentElement.classList.contains("sb") &&
|
||||||
listElement.parentElement.getAttribute("data-sb-layout") === "col") {
|
listElement.parentElement.getAttribute("data-sb-layout") === "col") {
|
||||||
const selectsElement: Element[] = []
|
const selectsElement: Element[] = [];
|
||||||
let previousElement: Element = listElement;
|
let previousElement: Element = listElement;
|
||||||
while (previousElement) {
|
while (previousElement) {
|
||||||
selectsElement.push(previousElement);
|
selectsElement.push(previousElement);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue