Skip to content

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

:rotating_light:

Vanessae7a45d402679
diff --git a/app/src/config/about.ts b/app/src/config/about.ts
index 9b25508054..e5f9ac2d7c 100644
--- a/app/src/config/about.ts
+++ b/app/src/config/about.ts
@@ -3,7 +3,7 @@ import {Constants} from "../constants";
import {shell} from "electron";
import {dialog} from "@electron/remote";
/// #endif
-import {isBrowser, isMobile} from "../util/functions";
+import {isBrowser} from "../util/functions";
import {fetchPost} from "../util/fetch";
import {setAccessAuthCode} from "./util";
import {exportLayout} from "../layout/util";
@@ -214,7 +214,7 @@ export const about = {
<button class="b3-button b3-button--cancel">${window.siyuan.languages.cancel}</button><div class="fn__space"></div>
<button class="b3-button b3-button--text">${window.siyuan.languages.confirm}</button>
</div>`,
- width: isMobile() ? "80vw" : "520px",
+ width: "520px",
});
const textAreaElement = passwordDialog.element.querySelector("textarea");
textAreaElement.focus();
diff --git a/app/src/layout/util.ts b/app/src/layout/util.ts
index 1a614bc645..15cd75ff22 100644
--- a/app/src/layout/util.ts
+++ b/app/src/layout/util.ts
@@ -396,13 +396,13 @@ export const layoutToJSON = (layout: Layout | Wnd | Tab | Model, json: any) => {
export const resizeDrag = () => {
const dragElement = document.getElementById("drag");
- const right = dragElement.getBoundingClientRect().left - document.querySelector("#windowControls").clientWidth
+ const right = dragElement.getBoundingClientRect().left - document.querySelector("#windowControls").clientWidth;
if (right < dragElement.clientWidth) {
dragElement.style.paddingRight = right + "px";
} else {
dragElement.style.paddingRight = "";
}
-}
+};
export const resizeTabs = () => {
const models = getAllModels();
diff --git a/app/src/protyle/wysiwyg/list.ts b/app/src/protyle/wysiwyg/list.ts
index 3c6eea2614..90b198ae0d 100644
--- a/app/src/protyle/wysiwyg/list.ts
+++ b/app/src/protyle/wysiwyg/list.ts
@@ -176,55 +176,55 @@ export const listIndent = (protyle: IProtyle, liItemElements: Element[], range:
};
export const breakList = (protyle: IProtyle, blockElement: Element, range: Range) => {
- const listItemElement = blockElement.parentElement
- const listItemId = listItemElement.getAttribute("data-node-id")
+ const listItemElement = blockElement.parentElement;
+ const listItemId = listItemElement.getAttribute("data-node-id");
const doOperations: IOperation[] = [];
const undoOperations: IOperation[] = [];
- range.insertNode(document.createElement("wbr"))
- const newListId = Lute.NewNodeID()
- let newListHTML = ''
- let hasFind = 0
+ range.insertNode(document.createElement("wbr"));
+ const newListId = Lute.NewNodeID();
+ let newListHTML = "";
+ let hasFind = 0;
Array.from(listItemElement.parentElement.children).forEach(item => {
if (!hasFind && item.isSameNode(listItemElement)) {
- hasFind = 1
+ hasFind = 1;
} else if (hasFind && !item.classList.contains("protyle-attr")) {
undoOperations.push({
id: item.getAttribute("data-node-id"),
action: "move",
previousID: listItemId,
- })
+ });
doOperations.push({
id: item.getAttribute("data-node-id"),
action: "delete",
- })
+ });
if (item.getAttribute("data-subtype") === "o") {
undoOperations.push({
id: item.getAttribute("data-node-id"),
action: "update",
data: item.outerHTML,
- })
- item.setAttribute("data-marker", hasFind + ".")
- item.firstElementChild.innerHTML = hasFind + "."
+ });
+ item.setAttribute("data-marker", hasFind + ".");
+ item.firstElementChild.innerHTML = hasFind + ".";
}
- newListHTML += item.outerHTML
+ newListHTML += item.outerHTML;
item.remove();
hasFind++;
}
- })
+ });
undoOperations.reverse();
- newListHTML = `<div data-subtype="${listItemElement.getAttribute("data-subtype")}" data-node-id="${newListId}" data-type="NodeList" class="list" updated="${dayjs().format("YYYYMMDDHHmmss")}">${newListHTML}<div class="protyle-attr" contenteditable="false">${Constants.ZWSP}</div></div>`
+ newListHTML = `<div data-subtype="${listItemElement.getAttribute("data-subtype")}" data-node-id="${newListId}" data-type="NodeList" class="list" updated="${dayjs().format("YYYYMMDDHHmmss")}">${newListHTML}<div class="protyle-attr" contenteditable="false">${Constants.ZWSP}</div></div>`;
listItemElement.parentElement.insertAdjacentHTML("afterend", newListHTML);
doOperations.push({
id: newListId,
action: "insert",
previousID: listItemElement.parentElement.getAttribute("data-node-id"),
data: newListHTML
- })
+ });
undoOperations.push({
id: newListId,
action: "delete"
- })
+ });
Array.from(listItemElement.children).reverse().forEach((item) => {
if (!item.classList.contains("protyle-action") && !item.classList.contains("protyle-attr")) {
@@ -232,30 +232,30 @@ export const breakList = (protyle: IProtyle, blockElement: Element, range: Range
id: item.getAttribute("data-node-id"),
action: "move",
previousID: listItemElement.parentElement.getAttribute("data-node-id")
- })
+ });
undoOperations.push({
id: item.getAttribute("data-node-id"),
action: "move",
parentID: listItemId
- })
+ });
listItemElement.parentElement.after(item);
}
- })
+ });
undoOperations.splice(0, 0, {
id: listItemId,
action: "insert",
data: listItemElement.outerHTML,
previousID: listItemElement.previousElementSibling.getAttribute("data-node-id"),
parentID: listItemElement.parentElement.getAttribute("data-node-id")
- })
- listItemElement.remove()
+ });
+ listItemElement.remove();
doOperations.push({
id: listItemId,
action: "delete",
- })
+ });
transaction(protyle, doOperations, undoOperations);
focusByWbr(protyle.wysiwyg.element, range);
-}
+};
export const listOutdent = (protyle: IProtyle, liItemElements: Element[], range: Range) => {
const liElement = liItemElements[0].parentElement;