This commit is contained in:
Vanessa 2023-09-26 10:33:33 +08:00
parent 56d12a2009
commit 4d908e62bd
9 changed files with 14 additions and 17 deletions

View file

@ -46,7 +46,7 @@ export class Files extends Model {
break; break;
case "createnotebook": case "createnotebook":
setNoteBook((notebooks) => { setNoteBook((notebooks) => {
let previousId: string let previousId: string;
notebooks.find(item => { notebooks.find(item => {
if (!item.closed) { if (!item.closed) {
if (item.id === data.data.box.id) { if (item.id === data.data.box.id) {
@ -59,7 +59,7 @@ export class Files extends Model {
} }
previousId = item.id; previousId = item.id;
} }
}) });
}); });
break; break;
case "unmount": case "unmount":

View file

@ -128,7 +128,7 @@ class App {
} }
} }
} }
}) });
}); });
} }
} }

View file

@ -30,7 +30,6 @@ import {openTitleMenu} from "../header/openTitleMenu";
import {emitOpenMenu} from "../../plugin/EventBus"; import {emitOpenMenu} from "../../plugin/EventBus";
import {isInAndroid} from "../util/compatibility"; import {isInAndroid} from "../util/compatibility";
import {resize} from "../util/resize"; import {resize} from "../util/resize";
import {transferBlockRef} from "../../menus/block";
export class Breadcrumb { export class Breadcrumb {
public element: HTMLElement; public element: HTMLElement;

View file

@ -47,13 +47,13 @@ export const hintSlash = (key: string, protyle: IProtyle) => {
filter: ["ai chat"], filter: ["ai chat"],
value: Constants.ZWSP + 5, value: Constants.ZWSP + 5,
html: '<div class="b3-list-item__first"><svg class="b3-list-item__graphic"><use xlink:href="#iconSparkles"></use></svg><span class="b3-list-item__text">AI Chat</span></div>', html: '<div class="b3-list-item__first"><svg class="b3-list-item__graphic"><use xlink:href="#iconSparkles"></use></svg><span class="b3-list-item__text">AI Chat</span></div>',
}] }];
if (isPaidUser()) { if (isPaidUser()) {
allList.push({ allList.push({
filter: ["数据库", "属性视图", "shujuku", "shuxingshitu", "sjk", "sxst", "database", "attribute view"], filter: ["数据库", "属性视图", "shujuku", "shuxingshitu", "sjk", "sxst", "database", "attribute view"],
value: '<div data-type="NodeAttributeView" data-av-type="table"></div>', value: '<div data-type="NodeAttributeView" data-av-type="table"></div>',
html: `<div class="b3-list-item__first"><svg class="b3-list-item__graphic"><use xlink:href="#iconDatabase"></use></svg><span class="b3-list-item__text">${window.siyuan.languages.database}</span></div>`, html: `<div class="b3-list-item__first"><svg class="b3-list-item__graphic"><use xlink:href="#iconDatabase"></use></svg><span class="b3-list-item__text">${window.siyuan.languages.database}</span></div>`,
}) });
} }
[{ [{
filter: ["文档", "子文档", "wendang", "wd", "ziwendang", "zwd", "xjwd"], filter: ["文档", "子文档", "wendang", "wd", "ziwendang", "zwd", "xjwd"],

View file

@ -115,7 +115,7 @@ export const updateAssetCell = (options: {
const colId = options.cellElements[0].dataset.colId; const colId = options.cellElements[0].dataset.colId;
const cellDoOperations: IOperation[] = []; const cellDoOperations: IOperation[] = [];
const cellUndoOperations: IOperation[] = []; const cellUndoOperations: IOperation[] = [];
let newValue: IAVCellAssetValue[] = [] let newValue: IAVCellAssetValue[] = [];
options.cellElements.forEach((item, elementIndex) => { options.cellElements.forEach((item, elementIndex) => {
let cellData: IAVCell; let cellData: IAVCell;
const rowID = item.parentElement.dataset.id; const rowID = item.parentElement.dataset.id;
@ -197,7 +197,7 @@ export const updateAssetCell = (options: {
} }
}); });
if (item.classList.contains("custom-attr__avvalue")) { if (item.classList.contains("custom-attr__avvalue")) {
item.innerHTML = genAVValueHTML(cellData.value) item.innerHTML = genAVValueHTML(cellData.value);
} else { } else {
updateAttrViewCellAnimation(item); updateAttrViewCellAnimation(item);
} }

View file

@ -2,8 +2,6 @@ import {fetchPost} from "../../../util/fetch";
import {getColIconByType} from "./col"; import {getColIconByType} from "./col";
import {escapeAttr} from "../../../util/escape"; import {escapeAttr} from "../../../util/escape";
import {hasClosestByAttribute} from "../../util/hasClosest"; import {hasClosestByAttribute} from "../../util/hasClosest";
import {Menu} from "../../../plugin/Menu";
import {Constants} from "../../../constants";
import * as dayjs from "dayjs"; import * as dayjs from "dayjs";
import {popTextCell} from "./cell"; import {popTextCell} from "./cell";

View file

@ -232,7 +232,7 @@ export const openMenuPanel = (options: {
} }
if (type === "assets") { if (type === "assets") {
if (isTop) { if (isTop) {
targetElement.before(sourceElement) targetElement.before(sourceElement);
} else { } else {
targetElement.after(sourceElement); targetElement.after(sourceElement);
} }
@ -243,9 +243,9 @@ export const openMenuPanel = (options: {
content: item.dataset.content, content: item.dataset.content,
name: item.dataset.name, name: item.dataset.name,
type: item.dataset.type as "image" | "file", type: item.dataset.type as "image" | "file",
}) });
} }
}) });
updateAssetCell({ updateAssetCell({
protyle: options.protyle, protyle: options.protyle,
data, data,

View file

@ -52,7 +52,7 @@ export const removeCellOption = (protyle: IProtyle, data: IAV, cellElements: HTM
const colId = cellElements[0].dataset.colId; const colId = cellElements[0].dataset.colId;
const doOperations: IOperation[] = []; const doOperations: IOperation[] = [];
const undoOperations: IOperation[] = []; const undoOperations: IOperation[] = [];
let newData: IAVCellSelectValue[] let newData: IAVCellSelectValue[];
cellElements.forEach((item, elementIndex) => { cellElements.forEach((item, elementIndex) => {
const rowID = item.parentElement.dataset.id; const rowID = item.parentElement.dataset.id;
const cellId = item.dataset.id; const cellId = item.dataset.id;
@ -434,7 +434,7 @@ export const addColOptionOrCell = (protyle: IProtyle, data: IAV, cellElements: H
const cellDoOperations: IOperation[] = []; const cellDoOperations: IOperation[] = [];
const cellUndoOperations: IOperation[] = []; const cellUndoOperations: IOperation[] = [];
let newValue: IAVCellSelectValue[] let newValue: IAVCellSelectValue[];
cellElements.forEach((item, index) => { cellElements.forEach((item, index) => {
let cellData: IAVCell; let cellData: IAVCell;
const rowID = item.parentElement.dataset.id; const rowID = item.parentElement.dataset.id;
@ -474,7 +474,7 @@ export const addColOptionOrCell = (protyle: IProtyle, data: IAV, cellElements: H
content: currentElement.dataset.name content: currentElement.dataset.name
}); });
} }
newValue = cellData.value.mSelect newValue = cellData.value.mSelect;
} else { } else {
cellData.value.mSelect = newValue; cellData.value.mSelect = newValue;
} }

View file

@ -31,4 +31,4 @@ export const needSubscribe = (tip = window.siyuan.languages._kernel[29]) => {
export const isPaidUser = () => { export const isPaidUser = () => {
return window.siyuan.user && (0 === window.siyuan.user.userSiYuanSubscriptionStatus || 1 === window.siyuan.user.userSiYuanOneTimePayStatus); return window.siyuan.user && (0 === window.siyuan.user.userSiYuanSubscriptionStatus || 1 === window.siyuan.user.userSiYuanOneTimePayStatus);
} };