From 44f866ec8e742ccb376c00bb35c8c51e1032e9ae Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Wed, 17 May 2023 09:24:28 +0800 Subject: [PATCH 1/4] :art: No more quote font optimization Fix https://github.com/siyuan-note/siyuan/issues/8281 --- app/appearance/themes/daylight/theme.css | 2 +- app/appearance/themes/midnight/theme.css | 2 +- app/src/util/assets.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/appearance/themes/daylight/theme.css b/app/appearance/themes/daylight/theme.css index 7ea41dfdb..992c34288 100644 --- a/app/appearance/themes/daylight/theme.css +++ b/app/appearance/themes/daylight/theme.css @@ -21,7 +21,7 @@ --b3-theme-on-error: #fff; /* 字体 */ - --b3-font-family: "quote", "Helvetica Neue", "Luxi Sans", "DejaVu Sans", "Hiragino Sans GB", "Microsoft Yahei", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols"; + --b3-font-family: "Helvetica Neue", "Luxi Sans", "DejaVu Sans", "Hiragino Sans GB", "Microsoft Yahei", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols"; --b3-font-family-code: "JetBrainsMono-Regular", mononoki, Consolas, "Liberation Mono", Menlo, Courier, monospace, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols"; --b3-font-family-graph: mononoki; --b3-font-family-emoji: "Segoe UI Emoji", "Segoe UI Symbol", "Segoe UI", "Apple Color Emoji", "Twemoji Mozilla", "Noto Color Emoji", "Android Emoji"; diff --git a/app/appearance/themes/midnight/theme.css b/app/appearance/themes/midnight/theme.css index af1f59a8e..4ee591061 100644 --- a/app/appearance/themes/midnight/theme.css +++ b/app/appearance/themes/midnight/theme.css @@ -21,7 +21,7 @@ --b3-theme-on-error: #fff; /* 字体 */ - --b3-font-family: "quote", "Helvetica Neue", "Luxi Sans", "DejaVu Sans", "Hiragino Sans GB", "Microsoft Yahei", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols"; + --b3-font-family: "Helvetica Neue", "Luxi Sans", "DejaVu Sans", "Hiragino Sans GB", "Microsoft Yahei", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols"; --b3-font-family-code: "JetBrainsMono-Regular", mononoki, Consolas, "Liberation Mono", Menlo, Courier, monospace, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols"; --b3-font-family-graph: mononoki; --b3-font-family-emoji: "Segoe UI Emoji", "Segoe UI Symbol", "Segoe UI", "Apple Color Emoji", "Twemoji Mozilla", "Noto Color Emoji", "Android Emoji"; diff --git a/app/src/util/assets.ts b/app/src/util/assets.ts index a702a48ae..d0160db15 100644 --- a/app/src/util/assets.ts +++ b/app/src/util/assets.ts @@ -223,7 +223,7 @@ export const setInlineStyle = (set = true) => { .protyle-wysiwyg .h5 img.emoji, .b3-typography h5 img.emoji {width:${Math.floor(window.siyuan.config.editor.fontSize * 1.13 * 1.25)}px} .protyle-wysiwyg .h6 img.emoji, .b3-typography h6 img.emoji {width:${Math.floor(window.siyuan.config.editor.fontSize * 1.25)}px}`; if (window.siyuan.config.editor.fontFamily) { - style += `.b3-typography:not(.b3-typography--default), .protyle-wysiwyg, .protyle-title, .protyle-title__input{font-family: "${window.siyuan.config.editor.fontFamily}", "quote", "Helvetica Neue", "Luxi Sans", "DejaVu Sans", "Hiragino Sans GB", "Microsoft Yahei", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols" !important;}`; + style += `.b3-typography:not(.b3-typography--default), .protyle-wysiwyg, .protyle-title, .protyle-title__input{font-family: "${window.siyuan.config.editor.fontFamily}", "Helvetica Neue", "Luxi Sans", "DejaVu Sans", "Hiragino Sans GB", "Microsoft Yahei", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols" !important;}`; } if (set) { document.getElementById("editorFontSize").innerHTML = style; From c336a4d64ecd81e19569bf830fa2ab135f0f7480 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Wed, 17 May 2023 09:38:12 +0800 Subject: [PATCH 2/4] :memo: Update doc of kernel API `insertBlock` Fix https://github.com/siyuan-note/siyuan/issues/8270 --- API.md | 13 ++++++++++--- API_zh_CN.md | 12 +++++++++--- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/API.md b/API.md index d8f28fa8e..f7eea2206 100644 --- a/API.md +++ b/API.md @@ -502,13 +502,20 @@ View API token in Settings - About, request header: `Authorization: T { "dataType": "markdown", "data": "foo**bar**{: style=\"color: var(--b3-font-color8);\"}baz", - "previousID": "20211229114650-vrek5x6" + "nextID": "", + "previousID": "20211229114650-vrek5x6", + "parentID": "" } ``` * `dataType`: The data type to be inserted, the value can be `markdown` or `dom` * `data`: Data to be inserted + * `nextID`: The ID of the next block, used to anchor the insertion position * `previousID`: The ID of the previous block, used to anchor the insertion position + * `parentID`: The ID of the parent block, used to anchor the insertion position + + `nextID`, `previousID`, and `parentID` must have at least one value, using + priority: `nextID` > `previousID` > `parentID` * Return value ```json @@ -781,8 +788,8 @@ View API token in Settings - About, request header: `Authorization: T } ``` - * `id`: Parent block ID - * The blocks below a heading are also counted as child blocks + * `id`: Parent block ID + * The blocks below a heading are also counted as child blocks * Return value ```json diff --git a/API_zh_CN.md b/API_zh_CN.md index 2123c1ac7..01c0d7f44 100644 --- a/API_zh_CN.md +++ b/API_zh_CN.md @@ -496,13 +496,19 @@ { "dataType": "markdown", "data": "foo**bar**{: style=\"color: var(--b3-font-color8);\"}baz", - "previousID": "20211229114650-vrek5x6" + "nextID": "", + "previousID": "20211229114650-vrek5x6", + "parentID": "" } ``` * `dataType`:待插入数据类型,值可选择 `markdown` 或者 `dom` * `data`:待插入的数据 + * `nextID`:后一个块的 ID,用于锚定插入位置 * `previousID`:前一个块的 ID,用于锚定插入位置 + * `parentID`:父块 ID,用于锚定插入位置 + + `nextID`、`previousID`、`parentID` 三个参数必须至少存在一个有值,优先级为 `nextID` > `previousID` > `parentID` * 返回值 ```json @@ -774,8 +780,8 @@ } ``` - * `id`:父块 ID - * 标题下方块也算作子块 + * `id`:父块 ID + * 标题下方块也算作子块 * 返回值 ```json From 9ab5657c4f6e2a97bb91c688f17e0a590be9e7dc Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Wed, 17 May 2023 09:41:42 +0800 Subject: [PATCH 3/4] :fire: Remove automatic update on Linux Fix https://github.com/siyuan-note/siyuan/issues/8275 --- kernel/model/updater.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/kernel/model/updater.go b/kernel/model/updater.go index 7c5767287..beea0b9de 100644 --- a/kernel/model/updater.go +++ b/kernel/model/updater.go @@ -45,9 +45,6 @@ func execNewVerInstallPkg(newVerInstallPkgPath string) { } else if gulu.OS.IsDarwin() { exec.Command("chmod", "+x", newVerInstallPkgPath).CombinedOutput() cmd = exec.Command("open", newVerInstallPkgPath) - } else if gulu.OS.IsLinux() { - exec.Command("chmod", "+x", newVerInstallPkgPath).CombinedOutput() - cmd = exec.Command("sh", "-c", newVerInstallPkgPath) } gulu.CmdAttr(cmd) cmdErr := cmd.Start() @@ -133,8 +130,6 @@ func getUpdatePkg() (downloadPkgURLs []string, checksum string, err error) { } else { suffix = "mac.dmg" } - } else if gulu.OS.IsLinux() { - suffix = "linux.AppImage" } pkg := "siyuan-" + ver + "-" + suffix @@ -287,7 +282,7 @@ func isVersionUpToDate(releaseVer string) bool { } func skipNewVerInstallPkg() bool { - if !gulu.OS.IsWindows() && !gulu.OS.IsDarwin() && !gulu.OS.IsLinux() { + if !gulu.OS.IsWindows() && !gulu.OS.IsDarwin() { return true } if util.ISMicrosoftStore || util.ContainerStd != util.Container { From 4125a61fc6516a23baa7696c48d67b05ba93772f Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Wed, 17 May 2023 10:11:00 +0800 Subject: [PATCH 4/4] :bug: Custom sorting not maintained after importing .sy.zip Fix https://github.com/siyuan-note/siyuan/issues/8283 --- kernel/model/import.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/kernel/model/import.go b/kernel/model/import.go index e5d48d6ed..185b1accb 100644 --- a/kernel/model/import.go +++ b/kernel/model/import.go @@ -243,13 +243,16 @@ func ImportSY(zipPath, boxID, toPath string) (err error) { sortData, sortErr = gulu.JSON.MarshalJSON(fullSortIDs) if nil != sortErr { - logging.LogErrorf("marshal temp full sort conf failed: %s", sortErr) + logging.LogErrorf("marshal box full sort conf failed: %s", sortErr) } else { - sortErr = filelock.WriteFile(sortPath, sortData) + sortErr = filelock.WriteFile(boxSortPath, sortData) if nil != sortErr { - logging.LogErrorf("write temp full sort conf failed: %s", sortErr) + logging.LogErrorf("write box full sort conf failed: %s", sortErr) } } + if removeErr := os.RemoveAll(sortPath); nil != removeErr { + logging.LogErrorf("remove temp sort conf failed: %s", removeErr) + } } // 重命名文件路径