This commit is contained in:
Vanessa 2024-01-29 15:44:18 +08:00
parent c8bb337ede
commit 2a8f8abc8d
11 changed files with 23 additions and 23 deletions

View File

@ -634,7 +634,7 @@ export const bazaar = {
} catch (e) {
console.error("destroyTheme error: " + e);
}
window.siyuan.config.appearance = response.data.appearance
window.siyuan.config.appearance = response.data.appearance;
loadAssets(window.siyuan.config.appearance);
} else {
exportLayout({
@ -796,7 +796,7 @@ export const bazaar = {
} catch (e) {
console.error("destroyTheme error: " + e);
}
window.siyuan.config.appearance = appearanceResponse.data
window.siyuan.config.appearance = appearanceResponse.data;
loadAssets(window.siyuan.config.appearance);
} else {
exportLayout({

View File

@ -188,7 +188,7 @@ export const exportImage = (id: string) => {
item.innerHTML = symbolElements[symbolElements.length - 1].innerHTML;
});
previewElement.querySelectorAll(".img img").forEach((item: HTMLImageElement) => {
const imgSrc = item.getAttribute("src")
const imgSrc = item.getAttribute("src");
if (imgSrc.endsWith(".svg")) {
fetchGet(item.src, (response: string) => {
item.src = `data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(response)))}`;

View File

@ -791,7 +791,7 @@ export class Gutter {
icon: "iconDatabase",
click: () => {
openSearchAV("", this.element, (listItemElement) => {
const sourceIds: string[] = []
const sourceIds: string[] = [];
selectsElement.forEach(item => {
sourceIds.push(item.getAttribute("data-node-id"));
});

View File

@ -549,7 +549,7 @@ export const renderCellAttr = (cellElement: Element, value: IAVCellValue) => {
cellElement.setAttribute("data-detached", "true");
}
}
}
};
export const renderCell = (cellValue: IAVCellValue) => {
let text = "";

View File

@ -235,11 +235,11 @@ const filterItem = (listElement: Element, key: string) => {
if (item.textContent.includes(key)) {
item.classList.remove("fn__none");
} else {
item.classList.add("fn__none")
item.classList.add("fn__none");
}
}
})
}
});
};
export const bindRelationEvent = (options: {
menuElement: HTMLElement,
@ -290,9 +290,9 @@ export const bindRelationEvent = (options: {
const cellRect = options.cellElements[options.cellElements.length - 1].getBoundingClientRect();
setPosition(options.menuElement, cellRect.left, cellRect.bottom, cellRect.height);
options.menuElement.querySelector(".b3-menu__items .b3-menu__item").classList.add("b3-menu__item--current");
const inputElement = options.menuElement.querySelector("input")
const inputElement = options.menuElement.querySelector("input");
inputElement.focus();
const listElement = options.menuElement.querySelector(".b3-menu__items")
const listElement = options.menuElement.querySelector(".b3-menu__items");
inputElement.addEventListener("keydown", (event) => {
event.stopPropagation();
if (event.isComposing) {
@ -309,18 +309,18 @@ export const bindRelationEvent = (options: {
event.preventDefault();
event.stopPropagation();
}
})
});
inputElement.addEventListener("input", (event: InputEvent) => {
if (event.isComposing) {
return;
}
filterItem(listElement, inputElement.value);
event.stopPropagation();
})
});
inputElement.addEventListener("compositionend", (event) => {
event.stopPropagation();
filterItem(listElement, inputElement.value);
})
});
});
};
@ -397,7 +397,7 @@ export const setRelationCell = (protyle: IProtyle, nodeElement: HTMLElement, tar
separatorElement.insertAdjacentHTML("afterend", genSelectItemHTML("empty"));
}
}
menuElement.firstElementChild.classList.add("b3-menu__item--current")
menuElement.firstElementChild.classList.add("b3-menu__item--current");
}
updateCellsValue(protyle, nodeElement, newValue, cellElements);
};

View File

@ -131,7 +131,7 @@ style="width: ${index === 0 ? ((parseInt(column.width || "200") + 24) + "px") :
return;
}
// https://github.com/siyuan-note/siyuan/issues/10262
let checkClass = ""
let checkClass = "";
if (cell.valueType === "checkbox") {
checkClass = cell.value?.checkbox?.checked ? " av__cell-check" : " av__cell-uncheck";
}

View File

@ -34,7 +34,7 @@ const processAV = (range: Range, html: string, protyle: IProtyle, blockElement:
const avID = blockElement.dataset.avId;
const id = blockElement.dataset.nodeId;
cellElements.forEach((item: HTMLElement, elementIndex) => {
let cellValue: IAVCellValue = values[elementIndex]
let cellValue: IAVCellValue = values[elementIndex];
if (!cellValue) {
return;
}
@ -60,7 +60,7 @@ const processAV = (range: Range, html: string, protyle: IProtyle, blockElement:
// 类型不能转换时就不进行替换
return;
}
const content = cellValue[cellValue.type as "text"].content
const content = cellValue[cellValue.type as "text"].content;
if (!content) {
return;
}
@ -110,7 +110,7 @@ const processAV = (range: Range, html: string, protyle: IProtyle, blockElement:
}
return;
} catch (e) {
console.warn("insert cell: JSON.parse error")
console.warn("insert cell: JSON.parse error");
}
}
const text = protyle.lute.BlockDOM2EscapeMarkerContent(html);

View File

@ -6,7 +6,7 @@ import {lineNumberRender} from "../render/highlightRender";
import {stickyRow} from "../render/av/row";
export const resize = (protyle: IProtyle) => {
hideElements(["gutterOnly"], protyle)
hideElements(["gutterOnly"], protyle);
const abs = setPadding(protyle);
const MIN_ABS = 4;
// 不能 clearTimeout否则 split 时左侧无法 resize

View File

@ -1301,7 +1301,7 @@ export class WYSIWYG {
}
} else if (selectAVElement) {
const cellsValue = updateCellsValue(protyle, nodeElement);
html = JSON.stringify(cellsValue.json)
html = JSON.stringify(cellsValue.json);
textPlain = cellsValue.text;
} else {
const id = nodeElement.getAttribute("data-node-id");

View File

@ -315,7 +315,7 @@ export const setMode = (modeElementValue: number) => {
const updateMobileTheme = (OSTheme: string) => {
if (isInIOS() || isInAndroid()) {
setTimeout(() => {
const backgroundColor = getComputedStyle(document.body).getPropertyValue("--b3-theme-background").trim();
const backgroundColor = getComputedStyle(document.body).getPropertyValue("--b3-theme-background").trim().replace(" ", "");
let mode = window.siyuan.config.appearance.mode;
if (window.siyuan.config.appearance.modeOS) {
if (OSTheme === "dark") {

View File

@ -1,6 +1,6 @@
const isNormalItem = (currentHintElement: HTMLElement, className: string) => {
return currentHintElement.classList.contains("fn__none") || !currentHintElement.classList.contains(className)
}
return currentHintElement.classList.contains("fn__none") || !currentHintElement.classList.contains(className);
};
export const upDownHint = (listElement: Element, event: KeyboardEvent, classActiveName = "b3-list-item--focus") => {
let currentHintElement: HTMLElement = listElement.querySelector("." + classActiveName);