mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
700fbc41f5
3 changed files with 26 additions and 8 deletions
|
|
@ -41,7 +41,7 @@ import {countBlockWord} from "../../layout/status";
|
||||||
import {Constants} from "../../constants";
|
import {Constants} from "../../constants";
|
||||||
import {mathRender} from "../render/mathRender";
|
import {mathRender} from "../render/mathRender";
|
||||||
import {duplicateBlock} from "../wysiwyg/commonHotkey";
|
import {duplicateBlock} from "../wysiwyg/commonHotkey";
|
||||||
import {movePathTo} from "../../util/pathName";
|
import {movePathTo, useShell} from "../../util/pathName";
|
||||||
import {hintMoveBlock} from "../hint/extend";
|
import {hintMoveBlock} from "../hint/extend";
|
||||||
import {makeCard, quickMakeCard} from "../../card/makeCard";
|
import {makeCard, quickMakeCard} from "../../card/makeCard";
|
||||||
import {transferBlockRef} from "../../menus/block";
|
import {transferBlockRef} from "../../menus/block";
|
||||||
|
|
@ -59,6 +59,7 @@ import {addEditorToDatabase} from "../render/av/addToDatabase";
|
||||||
import {processClonePHElement} from "../render/util";
|
import {processClonePHElement} from "../render/util";
|
||||||
/// #if !MOBILE
|
/// #if !MOBILE
|
||||||
import {openFileById} from "../../editor/util";
|
import {openFileById} from "../../editor/util";
|
||||||
|
import * as path from "path";
|
||||||
/// #endif
|
/// #endif
|
||||||
import {checkFold} from "../../util/noRelyPCFunction";
|
import {checkFold} from "../../util/noRelyPCFunction";
|
||||||
import {clearSelect} from "../util/clearSelect";
|
import {clearSelect} from "../util/clearSelect";
|
||||||
|
|
@ -1559,6 +1560,14 @@ export class Gutter {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}).element);
|
}).element);
|
||||||
|
window.siyuan.menus.menu.append(new MenuItem({
|
||||||
|
id: "showDatabaseInFolder",
|
||||||
|
icon: "iconFolder",
|
||||||
|
label: window.siyuan.languages.showInFolder,
|
||||||
|
click() {
|
||||||
|
useShell("showItemInFolder", path.join(window.siyuan.config.system.dataDir, "storage", "av", nodeElement.getAttribute("data-av-id")) + ".json");
|
||||||
|
}
|
||||||
|
}).element);
|
||||||
} else if ((type === "NodeVideo" || type === "NodeAudio") && !protyle.disabled) {
|
} else if ((type === "NodeVideo" || type === "NodeAudio") && !protyle.disabled) {
|
||||||
window.siyuan.menus.menu.append(new MenuItem({id: "separator_VideoOrAudio", type: "separator"}).element);
|
window.siyuan.menus.menu.append(new MenuItem({id: "separator_VideoOrAudio", type: "separator"}).element);
|
||||||
window.siyuan.menus.menu.append(new MenuItem({
|
window.siyuan.menus.menu.append(new MenuItem({
|
||||||
|
|
|
||||||
|
|
@ -1525,17 +1525,25 @@ func (tx *Transaction) doUpdate(operation *Operation) (ret *TxErr) {
|
||||||
syncDelete2AvBlock(n, tree, tx)
|
syncDelete2AvBlock(n, tree, tx)
|
||||||
}
|
}
|
||||||
|
|
||||||
var needUnfoldParentHeading bool
|
|
||||||
if 0 < oldNode.HeadingLevel && (0 == updatedNode.HeadingLevel || oldNode.HeadingLevel < updatedNode.HeadingLevel) {
|
|
||||||
// 将不属于折叠标题的块移动到折叠标题下方,需要展开折叠标题
|
// 将不属于折叠标题的块移动到折叠标题下方,需要展开折叠标题
|
||||||
needUnfoldParentHeading = true
|
needUnfoldParentHeading := 0 < oldNode.HeadingLevel && (0 == updatedNode.HeadingLevel || oldNode.HeadingLevel < updatedNode.HeadingLevel)
|
||||||
|
|
||||||
|
parentFoldedHeading := treenode.GetParentFoldedHeading(oldNode)
|
||||||
|
// 将原先折叠标题下的块提升为与折叠标题同级或更高一级的标题时,需要在折叠标题后插入该提升后的标题块(只需要推送界面插入)
|
||||||
|
if needInsertAfterParentHeading := nil != parentFoldedHeading && 0 != updatedNode.HeadingLevel && updatedNode.HeadingLevel <= parentFoldedHeading.HeadingLevel; needInsertAfterParentHeading {
|
||||||
|
evt := util.NewCmdResult("transactions", 0, util.PushModeBroadcast)
|
||||||
|
evt.Data = []*Transaction{{
|
||||||
|
DoOperations: []*Operation{{Action: "insert", ID: updatedNode.ID, PreviousID: parentFoldedHeading.ID, Data: data}},
|
||||||
|
UndoOperations: []*Operation{{Action: "delete", ID: updatedNode.ID}},
|
||||||
|
}}
|
||||||
|
util.PushEvent(evt)
|
||||||
}
|
}
|
||||||
|
|
||||||
oldNode.InsertAfter(updatedNode)
|
oldNode.InsertAfter(updatedNode)
|
||||||
oldNode.Unlink()
|
oldNode.Unlink()
|
||||||
|
|
||||||
if needUnfoldParentHeading {
|
if needUnfoldParentHeading {
|
||||||
parentFoldedHeading := treenode.GetParentFoldedHeading(updatedNode)
|
parentFoldedHeading = treenode.GetParentFoldedHeading(updatedNode)
|
||||||
unfoldHeading(parentFoldedHeading)
|
unfoldHeading(parentFoldedHeading)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1590,8 +1598,9 @@ func unfoldHeading(heading *ast.Node) {
|
||||||
heading.RemoveIALAttr("heading-fold")
|
heading.RemoveIALAttr("heading-fold")
|
||||||
|
|
||||||
evt := util.NewCmdResult("transactions", 0, util.PushModeBroadcast)
|
evt := util.NewCmdResult("transactions", 0, util.PushModeBroadcast)
|
||||||
|
fillBlockRefCount(children)
|
||||||
evt.Data = []*Transaction{{
|
evt.Data = []*Transaction{{
|
||||||
DoOperations: []*Operation{{Action: "unfoldHeading", ID: heading.ID}},
|
DoOperations: []*Operation{{Action: "unfoldHeading", ID: heading.ID, RetData: renderBlockDOMByNodes(children, NewLute())}},
|
||||||
UndoOperations: []*Operation{{Action: "foldHeading", ID: heading.ID}},
|
UndoOperations: []*Operation{{Action: "foldHeading", ID: heading.ID}},
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
"FileDescription": "SiYuan Kernel",
|
"FileDescription": "SiYuan Kernel",
|
||||||
"FileVersion": "",
|
"FileVersion": "",
|
||||||
"InternalName": "",
|
"InternalName": "",
|
||||||
"LegalCopyright": "© 2024 Yunnan Liandi Technology Co., Ltd.",
|
"LegalCopyright": "© 2020-present Yunnan Liandi Technology Co., Ltd.",
|
||||||
"LegalTrademarks": "",
|
"LegalTrademarks": "",
|
||||||
"OriginalFilename": "",
|
"OriginalFilename": "",
|
||||||
"PrivateBuild": "",
|
"PrivateBuild": "",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue