Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Clean code

Daniele082ce983dd9
diff --git a/app/src/boot/globalEvent/keydown.ts b/app/src/boot/globalEvent/keydown.ts
index b5c5f5985b..d6a2ea1190 100644
--- a/app/src/boot/globalEvent/keydown.ts
+++ b/app/src/boot/globalEvent/keydown.ts
@@ -65,7 +65,6 @@ import {workspaceMenu} from "../../menus/workspace";
import {resize} from "../../protyle/util/resize";
import {Search} from "../../search";
import {Custom} from "../../layout/dock/Custom";
-import {Protyle} from "../../protyle";
import {transaction} from "../../protyle/wysiwyg/transaction";
import {quickMakeCard} from "../../card/makeCard";
import {copyPNG} from "../../menus/util";
@@ -221,7 +220,7 @@ const editKeydown = (app: App, event: KeyboardEvent) => {
protyle = item.protyle;
return true;
}
- })
+ });
}
}
if (!protyle) {
diff --git a/app/src/layout/dock/Backlink.ts b/app/src/layout/dock/Backlink.ts
index c1716a33f8..08b0c9d9ed 100644
--- a/app/src/layout/dock/Backlink.ts
+++ b/app/src/layout/dock/Backlink.ts
@@ -468,7 +468,7 @@ export class Backlink extends Model {
}
this.editors.forEach(item => {
item.destroy();
- })
+ });
const element = this.element.querySelector('.block__icon[data-type="refresh"] svg');
element.classList.add("fn__rotate");
fetchPost("/api/ref/refreshBacklink", {
diff --git a/app/src/layout/getAll.ts b/app/src/layout/getAll.ts
index 1a73859801..f439e0ce86 100644
--- a/app/src/layout/getAll.ts
+++ b/app/src/layout/getAll.ts
@@ -25,8 +25,8 @@ export const getAllEditor = () => {
});
models.custom.forEach(item => {
item.editors?.forEach(eItem => {
- editors.push(eItem)
- })
+ editors.push(eItem);
+ });
});
models.backlink.forEach(item => {
item.editors.forEach(editorItem => {
diff --git a/app/src/protyle/render/av/action.ts b/app/src/protyle/render/av/action.ts
index 6fe0f0bc1e..f13f62d95d 100644
--- a/app/src/protyle/render/av/action.ts
+++ b/app/src/protyle/render/av/action.ts
@@ -4,25 +4,25 @@ import {transaction} from "../../wysiwyg/transaction";
import {openEditorTab} from "../../../menus/util";
import {copySubMenu} from "../../../menus/commonMenuItem";
import {
- addDragFill, genCellValueByElement,
+ addDragFill,
+ genCellValueByElement,
getCellText,
getTypeByCellElement,
popTextCell,
renderCell,
- renderCellAttr, updateCellsValue,
+ renderCellAttr,
+ updateCellsValue,
updateHeaderCell
} from "./cell";
-import {getColIconByType, showColMenu} from "./col";
-import {deleteRow, insertRows, setPageSize, updateHeader} from "./row";
+import {addCol, getColIconByType, showColMenu} from "./col";
+import {deleteRow, insertRows, selectRow, setPageSize, updateHeader} from "./row";
import {emitOpenMenu} from "../../../plugin/EventBus";
-import {addCol} from "./col";
import {openMenuPanel} from "./openMenuPanel";
import {hintRef} from "../../hint/extend";
import {focusByRange} from "../../util/selection";
import {showMessage} from "../../../dialog/message";
import {previewImage} from "../../preview/image";
import {unicode2Emoji} from "../../../emoji";
-import {selectRow} from "./row";
import * as dayjs from "dayjs";
import {openCalcMenu} from "./calc";
import {avRender} from "./render";
@@ -283,7 +283,7 @@ export const avContextmenu = (protyle: IProtyle, rowElement: HTMLElement, positi
const srcs: IOperationSrcs[] = [];
const sourceIds: string[] = [];
rowElements.forEach(item => {
- const rowId = item.getAttribute("data-id")
+ const rowId = item.getAttribute("data-id");
const blockValue = genCellValueByElement("block", item.querySelector(".av__cell[data-block-id]"));
srcs.push({
content: blockValue.block.content,
@@ -291,7 +291,7 @@ export const avContextmenu = (protyle: IProtyle, rowElement: HTMLElement, positi
isDetached: blockValue.isDetached,
});
sourceIds.push(rowId);
- })
+ });
const avID = listItemElement.dataset.avId;
transaction(protyle, [{
action: "insertAttrViewBlock",
diff --git a/app/src/protyle/render/av/render.ts b/app/src/protyle/render/av/render.ts
index 7407af3a9b..7e744e57a3 100644
--- a/app/src/protyle/render/av/render.ts
+++ b/app/src/protyle/render/av/render.ts
@@ -191,11 +191,11 @@ ${cell.color ? `color:${cell.color};` : ""}">${renderCell(cell.value, rowIndex)}
viewData = item;
}
});
- let avBackground = '--av-background:var(--b3-theme-background)'
+ let avBackground = "--av-background:var(--b3-theme-background)";
if (e.style.backgroundColor) {
- avBackground = '--av-background:' + e.style.backgroundColor
+ avBackground = "--av-background:" + e.style.backgroundColor;
} else if (hasClosestByAttribute(e, "data-type", "NodeBlockQueryEmbed")) {
- avBackground = '--av-background:var(--b3-theme-surface)'
+ avBackground = "--av-background:var(--b3-theme-surface)";
}
e.firstElementChild.outerHTML = `<div class="av__container" style="${avBackground}">
<div class="av__header">
diff --git a/app/src/protyle/util/editorCommonEvent.ts b/app/src/protyle/util/editorCommonEvent.ts
index 5fab1bf48c..9c265d69d8 100644
--- a/app/src/protyle/util/editorCommonEvent.ts
+++ b/app/src/protyle/util/editorCommonEvent.ts
@@ -808,12 +808,12 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
item.querySelectorAll('[data-type="search-mark"]').forEach(markItem => {
markItem.outerHTML = markItem.innerHTML;
});
- const id = item.getAttribute("data-node-id")
+ const id = item.getAttribute("data-node-id");
sourceIds.push(id);
srcs.push({
id,
isDetached: false,
- })
+ });
});
hideElements(["gutter"], protyle);