This commit is contained in:
Vanessa 2023-10-10 16:15:24 +08:00
parent b0e3efa774
commit 2c36af78bc
14 changed files with 25 additions and 26 deletions

View file

@ -271,12 +271,12 @@ export class Breadcrumb {
click: async () => {
/// #if !BROWSER
if (window.siyuan.config.system.os === "darwin") {
const status = await ipcRenderer.invoke(Constants.SIYUAN_GET, {cmd: "getMicrophone"})
const status = await ipcRenderer.invoke(Constants.SIYUAN_GET, {cmd: "getMicrophone"});
if (["denied", "restricted", "unknown"].includes(status)) {
showMessage(window.siyuan.languages.microphoneDenied);
return;
} else if (status === "not-determined") {
const isAccess = await ipcRenderer.invoke(Constants.SIYUAN_GET, {cmd: "askMicrophone"})
const isAccess = await ipcRenderer.invoke(Constants.SIYUAN_GET, {cmd: "askMicrophone"});
if (!isAccess) {
showMessage(window.siyuan.languages.microphoneNotAccess);
return;

View file

@ -278,15 +278,15 @@ export const avContextmenu = (protyle: IProtyle, event: MouseEvent & { detail: a
menu.addSeparator();
const editAttrSubmenu: IMenu[] = [];
rowElement.parentElement.querySelectorAll(".av__row--header .av__cell").forEach((cellElement: HTMLElement) => {
let hideBlock = false
const selectElements: HTMLElement[] = Array.from(blockElement.querySelectorAll(`.av__row--select:not(.av__row--header) .av__cell[data-col-id="${cellElement.dataset.colId}"]`))
let hideBlock = false;
const selectElements: HTMLElement[] = Array.from(blockElement.querySelectorAll(`.av__row--select:not(.av__row--header) .av__cell[data-col-id="${cellElement.dataset.colId}"]`));
if (cellElement.dataset.dtype === "block") {
selectElements.find(item => {
if (!item.dataset.detached) {
hideBlock = true;
return true;
}
})
});
}
if (!hideBlock) {
editAttrSubmenu.push({

View file

@ -9,7 +9,7 @@ export const genAVValueHTML = (value: IAVCellValue) => {
let html = "";
switch (value.type) {
case "text":
html = `<textarea rows="${value.text.content.split('\n').length}" class="b3-text-field b3-text-field--text fn__flex-1">${value.text.content}</textarea>`;
html = `<textarea rows="${value.text.content.split("\n").length}" class="b3-text-field b3-text-field--text fn__flex-1">${value.text.content}</textarea>`;
break;
case "number":
html = `<input value="${value.number.content}" type="number" class="b3-text-field b3-text-field--text fn__flex-1">`;

View file

@ -424,7 +424,7 @@ export const showColMenu = (protyle: IProtyle, blockElement: Element, cellElemen
data: cellElement.dataset.icon,
}]);
iconElement.setAttribute("data-icon", unicode);
iconElement.innerHTML = unicode ? unicode2Emoji(unicode) : `<svg><use xlink:href="#${getColIconByType(type)}"></use></svg>`
iconElement.innerHTML = unicode ? unicode2Emoji(unicode) : `<svg><use xlink:href="#${getColIconByType(type)}"></use></svg>`;
updateAttrViewCellAnimation(cellElement);
});
event.preventDefault();

View file

@ -522,8 +522,8 @@ export const openMenuPanel = (options: {
avID,
data: target.dataset.icon,
}]);
target.innerHTML = unicode ? unicode2Emoji(unicode) : `<svg><use xlink:href="#${getColIconByType(target.dataset.colType as TAVCol)}"></use></svg>`
updateAttrViewCellAnimation(options.blockElement.querySelector(`.av__row--header .av__cell[data-col-id="${colId}"]`))
target.innerHTML = unicode ? unicode2Emoji(unicode) : `<svg><use xlink:href="#${getColIconByType(target.dataset.colType as TAVCol)}"></use></svg>`;
updateAttrViewCellAnimation(options.blockElement.querySelector(`.av__row--header .av__cell[data-col-id="${colId}"]`));
});
event.preventDefault();
event.stopPropagation();

View file

@ -534,7 +534,7 @@ export const focusBlock = (element: Element, parentElement?: HTMLElement, toStar
return false;
}
} else if (element.classList.contains("av")) {
const avTitleElement = element.querySelector(".av__title")
const avTitleElement = element.querySelector(".av__title");
if (avTitleElement) {
const range = document.createRange();
range.selectNodeContents(avTitleElement);

View file

@ -53,7 +53,6 @@ import {
upSelect
} from "./commonHotkey";
import {enterBack, fileAnnotationRefMenu, linkMenu, refMenu, setFold, tagMenu, zoomOut} from "../../menus/protyle";
import {removeEmbed} from "./removeEmbed";
import {openAttr} from "../../menus/commonMenuItem";
import {Constants} from "../../constants";
import {fetchPost} from "../../util/fetch";