Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2025-04-15 10:09:31 +08:00
commit 1474360c2a
12 changed files with 1402 additions and 1539 deletions

View File

@ -14,10 +14,10 @@ Install pnpm: `npm install -g pnpm@10.8.0`
Set the Electron mirror environment variable and install Electron:
* macOS/Linux: `ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ pnpm install electron@v34.5.1 -D`
* macOS/Linux: `ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ pnpm install electron@v34.5.0 -D`
* Windows:
* `SET ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/`
* `pnpm install electron@v34.5.1 -D`
* `pnpm install electron@v34.5.0 -D`
NPM mirror:
@ -27,7 +27,7 @@ NPM mirror:
On the desktop, go to the app folder to run:
* `pnpm install electron@v34.5.1-D`
* `pnpm install electron@v34.5.0-D`
* `pnpm run dev`
* `pnpm run start`

View File

@ -14,10 +14,10 @@
设置 Electron 镜像环境变量并安装 Electron
* macOS/Linux`ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ pnpm install electron@v34.5.1 -D`
* macOS/Linux`ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/ pnpm install electron@v34.5.0 -D`
* Windows
* `SET ELECTRON_MIRROR=https://npmmirror.com/mirrors/electron/`
* `pnpm install electron@v34.5.1 -D`
* `pnpm install electron@v34.5.0 -D`
NPM 镜像:
@ -27,7 +27,7 @@ NPM 镜像:
桌面端进入 app 文件夹运行:
* `pnpm install electron@v34.5.1-D`
* `pnpm install electron@v34.5.0-D`
* `pnpm run dev`
* `pnpm run start`

View File

@ -4,7 +4,7 @@
"description": "Refactor your thinking",
"homepage": "https://b3log.org/siyuan",
"main": "./electron/main.js",
"packageManager": "pnpm@10.8.0",
"packageManager": "pnpm@10.8.1",
"scripts": {
"lint": "eslint . --fix --cache",
"dev": "webpack --mode development",
@ -58,7 +58,7 @@
"clean-webpack-plugin": "^4.0.0",
"css-loader": "^6.7.1",
"dayjs": "^1.11.5",
"electron": "34.5.1",
"electron": "34.5.0",
"electron-builder": "26.0.11",
"encoding": "^0.1.13",
"esbuild-loader": "^3.0.1",

File diff suppressed because it is too large Load Diff

View File

@ -4,8 +4,8 @@ import {genNotebookOption} from "../../menus/onGetnotebookconf";
export const initFileTree = () => {
openModel({
title: window.siyuan.languages.editor,
icon: "iconEdit",
title: window.siyuan.languages.fileTree,
icon: "iconFiles",
html: `<label class="fn__flex b3-label">
<div class="fn__flex-1">
${window.siyuan.languages.fileTree18}

View File

@ -29,14 +29,14 @@ func reloadTag(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)
util.PushReloadTag()
model.ReloadTag()
}
func reloadFiletree(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)
util.PushReloadFiletree()
model.ReloadFiletree()
}
func reloadProtyle(c *gin.Context) {

View File

@ -31,7 +31,7 @@ func AutoSpace(rootID string) (err error) {
logging.LogInfof("formatting tree [%s]...", rootID)
util.PushProtyleLoading(rootID, Conf.Language(116))
defer util.PushReloadProtyle(rootID)
defer ReloadProtyle(rootID)
FlushTxQueue()

View File

@ -318,8 +318,8 @@ func RollbackDocHistory(boxID, historyPath string) (err error) {
if writeErr := indexWriteTreeIndexQueue(tree); nil != writeErr {
return
}
util.PushReloadFiletree()
util.PushReloadProtyle(rootID)
ReloadFiletree()
ReloadProtyle(rootID)
util.PushMsg(Conf.Language(102), 3000)
IncSync()

View File

@ -104,6 +104,14 @@ func refreshDocInfo0(tree *parse.Tree, size uint64) {
task.AppendAsyncTaskWithDelay(task.ReloadProtyle, 500*time.Millisecond, util.PushReloadDocInfo, docInfo)
}
func ReloadFiletree() {
task.AppendAsyncTaskWithDelay(task.ReloadFiletree, 200*time.Millisecond, util.PushReloadFiletree)
}
func ReloadTag() {
task.AppendAsyncTaskWithDelay(task.ReloadTag, 200*time.Millisecond, util.PushReloadTag)
}
func ReloadProtyle(rootID string) {
// 刷新关联的引用
defTree, _ := LoadTreeByBlockID(rootID)

View File

@ -1692,7 +1692,7 @@ func processSyncMergeResult(exit, byHand bool, mergeResult *dejavu.MergeResult,
upsertRootIDs, removeRootIDs := incReindex(upserts, removes)
needReloadFiletree = !needReloadUI && (needReloadFiletree || 0 < len(upsertRootIDs) || 0 < len(removeRootIDs))
if needReloadFiletree {
util.PushReloadFiletree()
ReloadFiletree()
}
go func() {

View File

@ -800,7 +800,7 @@ func FindReplace(keyword, replacement string, replaceTypes map[string]bool, ids
unlinks = append(unlinks, n)
}
util.PushReloadTag()
ReloadTag()
} else if n.IsTextMarkType("u") {
if !replaceTypes["u"] {
return ast.WalkContinue
@ -965,11 +965,15 @@ func replaceNodeTextMarkTextContent(n *ast.Node, method int, keyword, escapedKey
parse.NestedInlines2FlattedSpans(tree, false)
var replaceNodes []*ast.Node
var defIDs []string
for rNode := tree.Root.FirstChild.FirstChild; nil != rNode; rNode = rNode.Next {
replaceNodes = append(replaceNodes, rNode)
if blockRefID, _, _ := treenode.GetBlockRef(rNode); "" != blockRefID {
defIDs = append(defIDs, blockRefID)
bt := treenode.GetBlockTree(blockRefID)
if nil == bt {
continue
}
task.AppendAsyncTaskWithDelay(task.SetDefRefCount, util.SQLFlushInterval, refreshRefCount, bt.RootID, blockRefID)
}
}
@ -977,15 +981,6 @@ func replaceNodeTextMarkTextContent(n *ast.Node, method int, keyword, escapedKey
n.InsertBefore(rNode)
}
n.TextMarkTextContent = ""
for _, defID := range defIDs {
bt := treenode.GetBlockTree(defID)
if nil == bt {
continue
}
task.AppendAsyncTaskWithDelay(task.SetDefRefCount, util.SQLFlushInterval, refreshRefCount, bt.RootID, defID)
}
return
}

View File

@ -136,6 +136,8 @@ const (
CacheVirtualBlockRef = "task.cache.virtualBlockRef" // 缓存虚拟块引用
ReloadAttributeView = "task.reload.attributeView" // 重新加载属性视图
ReloadProtyle = "task.reload.protyle" // 重新加载编辑器
ReloadTag = "task.reload.tag" // 重新加载标签面板
ReloadFiletree = "task.reload.filetree" // 重新加载文档树面板
SetRefDynamicText = "task.ref.setDynamicText" // 设置引用的动态锚文本
SetDefRefCount = "task.def.setRefCount" // 设置定义的引用计数
UpdateIDs = "task.update.ids" // 更新 ID
@ -156,6 +158,8 @@ var uniqueActions = []string{
AssetContentDatabaseIndexCommit,
ReloadAttributeView,
ReloadProtyle,
ReloadTag,
ReloadFiletree,
SetRefDynamicText,
SetDefRefCount,
UpdateIDs,