diff --git a/Dockerfile b/Dockerfile
index dcb898b6a..fad8d1389 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -21,7 +21,7 @@ mkdir /artifacts
mv appearance stage guide changelogs /artifacts/
EORUN
-FROM golang:1.24-alpine AS go-build
+FROM golang:1.25-alpine AS go-build
RUN <
+ Version="3.4.1.0"/>
SiYuan
云南链滴科技有限公司
diff --git a/app/appx/AppxManifest.xml b/app/appx/AppxManifest.xml
index 94638baf2..082d5f969 100644
--- a/app/appx/AppxManifest.xml
+++ b/app/appx/AppxManifest.xml
@@ -9,7 +9,7 @@
+ Version="3.4.1.0"/>
SiYuan
云南链滴科技有限公司
diff --git a/app/changelogs/v3.3.0/v3.3.0.md b/app/changelogs/v3.3.x/v3.3.0/v3.3.0.md
similarity index 100%
rename from app/changelogs/v3.3.0/v3.3.0.md
rename to app/changelogs/v3.3.x/v3.3.0/v3.3.0.md
diff --git a/app/changelogs/v3.3.0/v3.3.0_zh_CHT.md b/app/changelogs/v3.3.x/v3.3.0/v3.3.0_zh_CHT.md
similarity index 100%
rename from app/changelogs/v3.3.0/v3.3.0_zh_CHT.md
rename to app/changelogs/v3.3.x/v3.3.0/v3.3.0_zh_CHT.md
diff --git a/app/changelogs/v3.3.0/v3.3.0_zh_CN.md b/app/changelogs/v3.3.x/v3.3.0/v3.3.0_zh_CN.md
similarity index 100%
rename from app/changelogs/v3.3.0/v3.3.0_zh_CN.md
rename to app/changelogs/v3.3.x/v3.3.0/v3.3.0_zh_CN.md
diff --git a/app/changelogs/v3.3.1/v3.3.1.md b/app/changelogs/v3.3.x/v3.3.1/v3.3.1.md
similarity index 100%
rename from app/changelogs/v3.3.1/v3.3.1.md
rename to app/changelogs/v3.3.x/v3.3.1/v3.3.1.md
diff --git a/app/changelogs/v3.3.1/v3.3.1_zh_CHT.md b/app/changelogs/v3.3.x/v3.3.1/v3.3.1_zh_CHT.md
similarity index 100%
rename from app/changelogs/v3.3.1/v3.3.1_zh_CHT.md
rename to app/changelogs/v3.3.x/v3.3.1/v3.3.1_zh_CHT.md
diff --git a/app/changelogs/v3.3.1/v3.3.1_zh_CN.md b/app/changelogs/v3.3.x/v3.3.1/v3.3.1_zh_CN.md
similarity index 100%
rename from app/changelogs/v3.3.1/v3.3.1_zh_CN.md
rename to app/changelogs/v3.3.x/v3.3.1/v3.3.1_zh_CN.md
diff --git a/app/changelogs/v3.3.2/v3.3.2.md b/app/changelogs/v3.3.x/v3.3.2/v3.3.2.md
similarity index 100%
rename from app/changelogs/v3.3.2/v3.3.2.md
rename to app/changelogs/v3.3.x/v3.3.2/v3.3.2.md
diff --git a/app/changelogs/v3.3.2/v3.3.2_zh_CHT.md b/app/changelogs/v3.3.x/v3.3.2/v3.3.2_zh_CHT.md
similarity index 100%
rename from app/changelogs/v3.3.2/v3.3.2_zh_CHT.md
rename to app/changelogs/v3.3.x/v3.3.2/v3.3.2_zh_CHT.md
diff --git a/app/changelogs/v3.3.2/v3.3.2_zh_CN.md b/app/changelogs/v3.3.x/v3.3.2/v3.3.2_zh_CN.md
similarity index 100%
rename from app/changelogs/v3.3.2/v3.3.2_zh_CN.md
rename to app/changelogs/v3.3.x/v3.3.2/v3.3.2_zh_CN.md
diff --git a/app/changelogs/v3.3.3/v3.3.3.md b/app/changelogs/v3.3.x/v3.3.3/v3.3.3.md
similarity index 100%
rename from app/changelogs/v3.3.3/v3.3.3.md
rename to app/changelogs/v3.3.x/v3.3.3/v3.3.3.md
diff --git a/app/changelogs/v3.3.3/v3.3.3_zh_CHT.md b/app/changelogs/v3.3.x/v3.3.3/v3.3.3_zh_CHT.md
similarity index 100%
rename from app/changelogs/v3.3.3/v3.3.3_zh_CHT.md
rename to app/changelogs/v3.3.x/v3.3.3/v3.3.3_zh_CHT.md
diff --git a/app/changelogs/v3.3.3/v3.3.3_zh_CN.md b/app/changelogs/v3.3.x/v3.3.3/v3.3.3_zh_CN.md
similarity index 100%
rename from app/changelogs/v3.3.3/v3.3.3_zh_CN.md
rename to app/changelogs/v3.3.x/v3.3.3/v3.3.3_zh_CN.md
diff --git a/app/changelogs/v3.3.4/v3.3.4.md b/app/changelogs/v3.3.x/v3.3.4/v3.3.4.md
similarity index 100%
rename from app/changelogs/v3.3.4/v3.3.4.md
rename to app/changelogs/v3.3.x/v3.3.4/v3.3.4.md
diff --git a/app/changelogs/v3.3.4/v3.3.4_zh_CHT.md b/app/changelogs/v3.3.x/v3.3.4/v3.3.4_zh_CHT.md
similarity index 100%
rename from app/changelogs/v3.3.4/v3.3.4_zh_CHT.md
rename to app/changelogs/v3.3.x/v3.3.4/v3.3.4_zh_CHT.md
diff --git a/app/changelogs/v3.3.4/v3.3.4_zh_CN.md b/app/changelogs/v3.3.x/v3.3.4/v3.3.4_zh_CN.md
similarity index 100%
rename from app/changelogs/v3.3.4/v3.3.4_zh_CN.md
rename to app/changelogs/v3.3.x/v3.3.4/v3.3.4_zh_CN.md
diff --git a/app/changelogs/v3.3.5/v3.3.5.md b/app/changelogs/v3.3.x/v3.3.5/v3.3.5.md
similarity index 100%
rename from app/changelogs/v3.3.5/v3.3.5.md
rename to app/changelogs/v3.3.x/v3.3.5/v3.3.5.md
diff --git a/app/changelogs/v3.3.5/v3.3.5_zh_CHT.md b/app/changelogs/v3.3.x/v3.3.5/v3.3.5_zh_CHT.md
similarity index 100%
rename from app/changelogs/v3.3.5/v3.3.5_zh_CHT.md
rename to app/changelogs/v3.3.x/v3.3.5/v3.3.5_zh_CHT.md
diff --git a/app/changelogs/v3.3.5/v3.3.5_zh_CN.md b/app/changelogs/v3.3.x/v3.3.5/v3.3.5_zh_CN.md
similarity index 100%
rename from app/changelogs/v3.3.5/v3.3.5_zh_CN.md
rename to app/changelogs/v3.3.x/v3.3.5/v3.3.5_zh_CN.md
diff --git a/app/changelogs/v3.3.6/v3.3.6.md b/app/changelogs/v3.3.x/v3.3.6/v3.3.6.md
similarity index 100%
rename from app/changelogs/v3.3.6/v3.3.6.md
rename to app/changelogs/v3.3.x/v3.3.6/v3.3.6.md
diff --git a/app/changelogs/v3.3.6/v3.3.6_zh_CHT.md b/app/changelogs/v3.3.x/v3.3.6/v3.3.6_zh_CHT.md
similarity index 100%
rename from app/changelogs/v3.3.6/v3.3.6_zh_CHT.md
rename to app/changelogs/v3.3.x/v3.3.6/v3.3.6_zh_CHT.md
diff --git a/app/changelogs/v3.3.6/v3.3.6_zh_CN.md b/app/changelogs/v3.3.x/v3.3.6/v3.3.6_zh_CN.md
similarity index 100%
rename from app/changelogs/v3.3.6/v3.3.6_zh_CN.md
rename to app/changelogs/v3.3.x/v3.3.6/v3.3.6_zh_CN.md
diff --git a/app/changelogs/v3.4.1/v3.4.1.md b/app/changelogs/v3.4.1/v3.4.1.md
new file mode 100644
index 000000000..a43220e1f
--- /dev/null
+++ b/app/changelogs/v3.4.1/v3.4.1.md
@@ -0,0 +1,40 @@
+## Overview
+
+This version improves some details.
+
+## Changelogs
+
+Below are the detailed changes in this version.
+
+### Enhancement
+
+* [The database-bound block no longer automatically adds to the database after being copied as a replica](https://github.com/siyuan-note/siyuan/issues/12294)
+* [Improve iframe/widget rendering](https://github.com/siyuan-note/siyuan/issues/16239)
+* [Support calling system printing on iOS](https://github.com/siyuan-note/siyuan/issues/16247)
+* [Supports executing JS snippets in the export interface.](https://github.com/siyuan-note/siyuan/issues/16300)
+* [The shortcut search does not include key conditions](https://github.com/siyuan-note/siyuan/issues/16356)
+* [Improve exit on Android](https://github.com/siyuan-note/siyuan/issues/16377)
+* [Center and highlight the block when opening search results.](https://github.com/siyuan-note/siyuan/issues/16379)
+* [Improve database operation interaction](https://github.com/siyuan-note/siyuan/issues/16381)
+* [Improve printing on mobile](https://github.com/siyuan-note/siyuan/issues/16385)
+* [Improve interface loading after switching themes and updating code snippets](https://github.com/siyuan-note/siyuan/issues/16390)
+* [Improve data indexing performance](https://github.com/siyuan-note/siyuan/issues/16397)
+* [Improve outline positioning](https://github.com/siyuan-note/siyuan/issues/16402)
+* [Improve HTML svg clipping](https://github.com/siyuan-note/siyuan/issues/16413)
+* [Add "Copy web URL" command to the Copy context menu on browser](https://github.com/siyuan-note/siyuan/pull/16415)
+* [Improve left and right arrow keys in ZWSP at the beginning of block](https://github.com/siyuan-note/siyuan/issues/16416)
+* [Image OCR supports more formats](https://github.com/siyuan-note/siyuan/issues/16418)
+* [Image OCR supports setting the timeout via the environment variable `SIYUAN_TESSERACT_TIMEOUT`](https://github.com/siyuan-note/siyuan/issues/16419)
+
+### Bugfix
+
+* [Using S3 data synchronization may cause kernel boot crashes](https://github.com/siyuan-note/siyuan/issues/16388)
+
+### Development
+
+* [Add `filetreeSortChanged` and `notebookSortChanged` to eventbus](https://github.com/siyuan-note/siyuan/issues/16383)
+
+## Download
+
+* [B3log](https://b3log.org/siyuan/en/download.html)
+* [GitHub](https://github.com/siyuan-note/siyuan/releases)
diff --git a/app/changelogs/v3.4.1/v3.4.1_zh_CHT.md b/app/changelogs/v3.4.1/v3.4.1_zh_CHT.md
new file mode 100644
index 000000000..b4d2da191
--- /dev/null
+++ b/app/changelogs/v3.4.1/v3.4.1_zh_CHT.md
@@ -0,0 +1,40 @@
+## 概述
+
+此版本改進了一些細節。
+
+## 變更記錄
+
+以下是此版本中的詳細變更。
+
+### 改進功能
+
+* [資料庫綁定的區塊在複製為副本後不再自動加入資料庫](https://github.com/siyuan-note/siyuan/issues/12294)
+* [改良 iframe/掛飾 的渲染](https://github.com/siyuan-note/siyuan/issues/16239)
+* [支援在 iOS 上呼叫系統列印](https://github.com/siyuan-note/siyuan/issues/16247)
+* [支援在匯出介面執行 JS 程式碼片段](https://github.com/siyuan-note/siyuan/issues/16300)
+* [快速搜尋不包含鍵位條件](https://github.com/siyuan-note/siyuan/issues/16356)
+* [改進 Android 上的退出](https://github.com/siyuan-note/siyuan/issues/16377)
+* [開啟搜尋結果時將區塊置中並加亮](https://github.com/siyuan-note/siyuan/issues/16379)
+* [改進資料庫操作互動](https://github.com/siyuan-note/siyuan/issues/16381)
+* [改進行動版列印](https://github.com/siyuan-note/siyuan/issues/16385)
+* [切換主題和更新程式碼片段後改進介面載入](https://github.com/siyuan-note/siyuan/issues/16390)
+* [改進資料索引效能](https://github.com/siyuan-note/siyuan/issues/16397)
+* [改進大綱定位](https://github.com/siyuan-note/siyuan/issues/16402)
+* [改進 HTML SVG 剪藏](https://github.com/siyuan-note/siyuan/issues/16413)
+* [在瀏覽器的複製上下文選單中新增「複製網頁 URL」](https://github.com/siyuan-note/siyuan/pull/16415)
+* [在區塊開頭的零寬空格(ZWSP)處改進左右箭頭鍵的行為](https://github.com/siyuan-note/siyuan/issues/16416)
+* [圖片 OCR 支援更多格式](https://github.com/siyuan-note/siyuan/issues/16418)
+* [圖片 OCR 支援透過環境變數 `SIYUAN_TESSERACT_TIMEOUT` 設定逾時](https://github.com/siyuan-note/siyuan/issues/16419)
+
+### 修復缺陷
+
+* [使用 S3 資料同步可能導致內核啟動時崩潰](https://github.com/siyuan-note/siyuan/issues/16388)
+
+### 開發者
+
+* [向 eventbus 新增 `filetreeSortChanged` 和 `notebookSortChanged`](https://github.com/siyuan-note/siyuan/issues/16383)
+
+## 下載
+
+* [B3log](https://b3log.org/siyuan/download.html)
+* [GitHub](https://github.com/siyuan-note/siyuan/releases)
diff --git a/app/changelogs/v3.4.1/v3.4.1_zh_CN.md b/app/changelogs/v3.4.1/v3.4.1_zh_CN.md
new file mode 100644
index 000000000..ab84d45cc
--- /dev/null
+++ b/app/changelogs/v3.4.1/v3.4.1_zh_CN.md
@@ -0,0 +1,40 @@
+## 概述
+
+此版本改进了一些细节。
+
+## 变更记录
+
+以下是此版本中的详细变更。
+
+### 改进功能
+
+* [数据库绑定的块在被复制为副本后不再自动添加到数据库](https://github.com/siyuan-note/siyuan/issues/12294)
+* [改进 iframe/挂件 的渲染](https://github.com/siyuan-note/siyuan/issues/16239)
+* [支持在 iOS 上调用系统打印](https://github.com/siyuan-note/siyuan/issues/16247)
+* [支持在导出界面执行 JS 代码片段](https://github.com/siyuan-note/siyuan/issues/16300)
+* [快捷搜索不包含键位条件](https://github.com/siyuan-note/siyuan/issues/16356)
+* [改进 Android 上的退出](https://github.com/siyuan-note/siyuan/issues/16377)
+* [打开搜索结果时将块居中并高亮](https://github.com/siyuan-note/siyuan/issues/16379)
+* [改进数据库操作交互](https://github.com/siyuan-note/siyuan/issues/16381)
+* [改进移动端打印](https://github.com/siyuan-note/siyuan/issues/16385)
+* [切换主题和更新代码片段后改进界面加载](https://github.com/siyuan-note/siyuan/issues/16390)
+* [改进数据索引性能](https://github.com/siyuan-note/siyuan/issues/16397)
+* [改进大纲定位](https://github.com/siyuan-note/siyuan/issues/16402)
+* [改进 HTML SVG 剪藏](https://github.com/siyuan-note/siyuan/issues/16413)
+* [在浏览器的复制上下文菜单中添加“复制网页 URL”](https://github.com/siyuan-note/siyuan/pull/16415)
+* [在块开头的零宽空格(ZWSP)处改进左右箭头键的行为](https://github.com/siyuan-note/siyuan/issues/16416)
+* [图片 OCR 支持更多格式](https://github.com/siyuan-note/siyuan/issues/16418)
+* [图片 OCR 支持通过环境变量 `SIYUAN_TESSERACT_TIMEOUT` 设置超时](https://github.com/siyuan-note/siyuan/issues/16419)
+
+### 修复缺陷
+
+* [使用 S3 数据同步可能导致内核启动时崩溃](https://github.com/siyuan-note/siyuan/issues/16388)
+
+### 开发者
+
+* [向 eventbus 添加 `filetreeSortChanged` 和 `notebookSortChanged`](https://github.com/siyuan-note/siyuan/issues/16383)
+
+## 下载
+
+* [B3log](https://b3log.org/siyuan/download.html)
+* [GitHub](https://github.com/siyuan-note/siyuan/releases)
diff --git a/app/electron/main.js b/app/electron/main.js
index 5dc444b7b..b8bb43c0d 100644
--- a/app/electron/main.js
+++ b/app/electron/main.js
@@ -1051,25 +1051,6 @@ app.whenReady().then(() => {
ipcMain.on("siyuan-quit", (event, port) => {
exitApp(port);
});
- ipcMain.on("siyuan-reload-window", (event, port) => {
- BrowserWindow.getAllWindows().forEach((item) => {
- try {
- const currentURL = new URL(item.getURL());
- if (port.toString() === currentURL.port.toString()) {
- const hasMain = workspaces.find((workspaceItem) => {
- if (workspaceItem.browserWindow.id === item.id) {
- return true;
- }
- });
- if (!hasMain) {
- item.reload();
- }
- }
- } catch (e) {
- // load file is not a url
- }
- });
- });
ipcMain.on("siyuan-show-window", (event) => {
const mainWindow = getWindowByContentId(event.sender.id);
if (!mainWindow) {
diff --git a/app/package.json b/app/package.json
index 5363f6aa2..84a10b937 100644
--- a/app/package.json
+++ b/app/package.json
@@ -1,10 +1,10 @@
{
"name": "SiYuan",
- "version": "3.4.0",
+ "version": "3.4.1",
"description": "Refactor your thinking",
"homepage": "https://b3log.org/siyuan",
"main": "./electron/main.js",
- "packageManager": "pnpm@10.20.0",
+ "packageManager": "pnpm@10.22.0",
"scripts": {
"lint": "eslint . --fix --cache",
"dev": "webpack --mode development",
diff --git a/app/src/assets/scss/business/_av.scss b/app/src/assets/scss/business/_av.scss
index 7a8997b7e..58b4ff23e 100644
--- a/app/src/assets/scss/business/_av.scss
+++ b/app/src/assets/scss/business/_av.scss
@@ -276,7 +276,6 @@
display: flex;
flex-direction: column;
position: relative;
- min-height: 40px;
&::before {
transition: background 100ms ease-out;
@@ -379,7 +378,7 @@
flex: 1;
white-space: nowrap;
font-size: 85%;
- min-height: 23px;
+ min-height: calc(1.625em + 4px);
padding: 5px 4px;
&:hover {
@@ -484,6 +483,8 @@
cursor: pointer;
transition: background 100ms ease-out, color 100ms ease-out;
position: relative;
+ font-size: 85%;
+ padding: 4px 0;
&:hover {
background-color: var(--b3-theme-surface-light);
@@ -941,7 +942,7 @@
.b3-chip {
padding: 0 6px;
line-height: 1.625;
- font-size: 87.5%;
+ font-size: 1em;
float: left;
margin-right: 8px;
diff --git a/app/src/assets/scss/component/_typography.scss b/app/src/assets/scss/component/_typography.scss
index fa8315ec9..2841752b1 100644
--- a/app/src/assets/scss/component/_typography.scss
+++ b/app/src/assets/scss/component/_typography.scss
@@ -34,15 +34,6 @@
border: 0;
}
- iframe {
- border: 1px solid var(--b3-theme-surface-lighter);
- width: 765px;
- box-sizing: border-box;
- height: 256px;
- max-width: 100%;
- vertical-align: bottom;
- }
-
span[data-type~="sup"],
span[data-type~="sub"] {
position: relative;
@@ -415,6 +406,29 @@
text-align: center;
}
+ [data-type="NodeIFrame"],
+ [data-type="NodeWidget"] {
+ height: 256px;
+ width: 100%;
+ max-width: 100%;
+
+ .iframe-content {
+ position: relative;
+ height: 100%;
+ width: 100%;
+ }
+
+ iframe {
+ width: 100%;
+ height: 100%;
+ border: 1px solid var(--b3-theme-surface-lighter);
+ box-sizing: border-box;
+ max-width: 100%;
+ min-height: 100%;
+ max-height: 100%;
+ }
+ }
+
[data-subtype="flowchart"] > [spin="1"],
[data-subtype="plantuml"] > [spin="1"],
[data-subtype="mermaid"] > [spin="1"] {
diff --git a/app/src/assets/scss/protyle/_wysiwyg.scss b/app/src/assets/scss/protyle/_wysiwyg.scss
index 26c98d461..ace850aca 100644
--- a/app/src/assets/scss/protyle/_wysiwyg.scss
+++ b/app/src/assets/scss/protyle/_wysiwyg.scss
@@ -508,14 +508,11 @@
&.iframe {
// https://ld246.com/article/1644827326901
// https://github.com/siyuan-note/siyuan/issues/4172
- &[data-type="NodeWidget"] .iframe-content,
- &[data-type="NodeIFrame"] .iframe-content {
- -webkit-user-modify: read-only;
- }
-
- .iframe-content {
- display: inline-block;
- position: relative;
+ &[data-type="NodeWidget"],
+ &[data-type="NodeIFrame"] {
+ .iframe-content {
+ -webkit-user-modify: read-only;
+ }
}
&--drag {
diff --git a/app/src/boot/globalEvent/searchKeydown.ts b/app/src/boot/globalEvent/searchKeydown.ts
index 1c05df0c6..2fa1280ef 100644
--- a/app/src/boot/globalEvent/searchKeydown.ts
+++ b/app/src/boot/globalEvent/searchKeydown.ts
@@ -99,13 +99,15 @@ export const searchKeydown = (app: App, event: KeyboardEvent) => {
if (searchType !== "asset") {
if (matchHotKey(window.siyuan.config.keymap.editor.general.insertRight.custom, event)) {
const id = currentList.getAttribute("data-node-id");
- checkFold(id, (zoomIn, action) => {
+ checkFold(id, (zoomIn) => {
openFileById({
app,
id,
position: "right",
- action,
- zoomIn
+ action: zoomIn ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL, Constants.CB_GET_HL] :
+ [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_HL],
+ zoomIn,
+ scrollPosition: "center"
});
if (dialog) {
dialog.destroy({focus: "false"});
@@ -221,12 +223,14 @@ export const searchKeydown = (app: App, event: KeyboardEvent) => {
replace(element, config, edit, false);
} else {
const id = currentList.getAttribute("data-node-id");
- checkFold(id, (zoomIn, action) => {
+ checkFold(id, (zoomIn) => {
openFileById({
app,
id,
- action,
- zoomIn
+ action: zoomIn ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL, Constants.CB_GET_HL] :
+ [Constants.CB_GET_FOCUS, Constants.CB_GET_CONTEXT, Constants.CB_GET_HL],
+ zoomIn,
+ scrollPosition: "center"
});
if (dialog) {
dialog.destroy({focus: "false"});
diff --git a/app/src/config/appearance.ts b/app/src/config/appearance.ts
index 45666121b..81f6a7de7 100644
--- a/app/src/config/appearance.ts
+++ b/app/src/config/appearance.ts
@@ -12,7 +12,6 @@ import {resetFloatDockSize} from "../layout/dock/util";
import {confirmDialog} from "../dialog/confirmDialog";
import {useShell} from "../util/pathName";
import {Dialog} from "../dialog";
-import {reloadOtherWindow} from "../dialog/processSystem";
export const appearance = {
element: undefined as Element,
@@ -207,46 +206,7 @@ export const appearance = {
msgTaskAssetDatabaseIndexCommitDisabled: statusBar ? statusBar.msgTaskAssetDatabaseIndexCommitDisabled : window.siyuan.config.appearance.statusBar.msgTaskAssetDatabaseIndexCommitDisabled,
msgTaskHistoryGenerateFileDisabled: statusBar ? statusBar.msgTaskHistoryGenerateFileDisabled : window.siyuan.config.appearance.statusBar.msgTaskHistoryGenerateFileDisabled,
}
- }, async response => {
- if (response.data.mode !== window.siyuan.config.appearance.mode ||
- (response.data.mode === window.siyuan.config.appearance.mode && (
- (response.data.mode === 0 && window.siyuan.config.appearance.themeLight !== response.data.themeLight) ||
- (response.data.mode === 1 && window.siyuan.config.appearance.themeDark !== response.data.themeDark))
- ) || response.data.lang !== window.siyuan.config.appearance.lang) {
- reloadOtherWindow();
- }
- if (window.siyuan.config.appearance.themeJS) {
- if (response.data.mode !== window.siyuan.config.appearance.mode ||
- (response.data.mode === window.siyuan.config.appearance.mode && (
- (response.data.mode === 0 && window.siyuan.config.appearance.themeLight !== response.data.themeLight) ||
- (response.data.mode === 1 && window.siyuan.config.appearance.themeDark !== response.data.themeDark))
- )
- ) {
- if (window.destroyTheme) {
- try {
- await window.destroyTheme();
- window.destroyTheme = undefined;
- document.getElementById("themeScript").remove();
- } catch (e) {
- console.error("destroyTheme error: " + e);
- }
- } else {
- exportLayout({
- errorExit: false,
- cb() {
- window.location.reload();
- },
- });
- return;
- }
- }
- }
- appearance.onSetAppearance(response.data);
- if (response.data.hideStatusBar) {
- document.getElementById("status").classList.add("fn__none");
- } else {
- document.getElementById("status").classList.remove("fn__none");
- }
+ }, () => {
resetFloatDockSize();
});
},
diff --git a/app/src/config/bazaar.ts b/app/src/config/bazaar.ts
index 21d0e10e3..7ef8d9678 100644
--- a/app/src/config/bazaar.ts
+++ b/app/src/config/bazaar.ts
@@ -1,9 +1,8 @@
-import {appearance} from "./appearance";
import {showMessage} from "../dialog/message";
import {fetchPost} from "../util/fetch";
import {confirmDialog} from "../dialog/confirmDialog";
import {highlightRender} from "../protyle/render/highlightRender";
-import {exportLayout, saveLayout} from "../layout/util";
+import {saveLayout} from "../layout/util";
import {Constants} from "../constants";
/// #if !BROWSER
import * as path from "path";
@@ -16,10 +15,7 @@ import {App} from "../index";
import {escapeAttr} from "../util/escape";
import {uninstall} from "../plugin/uninstall";
import {afterLoadPlugin, loadPlugin, loadPlugins, reloadPlugin} from "../plugin/loader";
-import {loadAssets} from "../util/assets";
-import {addScript} from "../protyle/util/addScript";
import {useShell} from "../util/pathName";
-import {reloadOtherWindow} from "../dialog/processSystem";
export const bazaar = {
element: undefined as Element,
@@ -674,28 +670,7 @@ export const bazaar = {
mode: dataObj.themeMode === "dark" ? 1 : 0,
frontend: getFrontend()
}, async response => {
- if (window.siyuan.config.appearance.themeJS && bazaarType === "themes") {
- if (window.destroyTheme) {
- try {
- await window.destroyTheme();
- window.destroyTheme = undefined;
- document.getElementById("themeScript").remove();
- } catch (e) {
- console.error("destroyTheme error: " + e);
- }
- window.siyuan.config.appearance = response.data.appearance;
- loadAssets(window.siyuan.config.appearance);
- } else {
- exportLayout({
- cb() {
- window.location.reload();
- },
- errorExit: false,
- });
- return;
- }
- }
- bazaar._onBazaar(response, bazaarType, ["themes", "icons"].includes(bazaarType));
+ bazaar._onBazaar(response, bazaarType);
bazaar._genMyHTML(bazaarType, app, false);
if (bazaarType === "plugins") {
if (window.siyuan.config.bazaar.petalDisabled) {
@@ -757,45 +732,14 @@ export const bazaar = {
frontend: getFrontend()
}, async response => {
this._genMyHTML(bazaarType, app);
- bazaar._onBazaar(response, bazaarType, ["icons"].includes(bazaarType));
+ bazaar._onBazaar(response, bazaarType);
// https://github.com/siyuan-note/siyuan/issues/15177
if (bazaarType === "themes" && response.data.appearance?.themeVer) {
window.siyuan.config.appearance.themeVer = response.data.appearance.themeVer;
}
// 更新主题后不需要对该主题进行切换 https://github.com/siyuan-note/siyuan/issues/4966
// https://github.com/siyuan-note/siyuan/issues/5411
- if (bazaarType === "themes" && (
- (window.siyuan.config.appearance.mode === 0 && window.siyuan.config.appearance.themeLight === dataObj.name) ||
- (window.siyuan.config.appearance.mode === 1 && window.siyuan.config.appearance.themeDark === dataObj.name)
- )) {
- const currentTheme = window.siyuan.config.appearance.mode === 1 ? window.siyuan.config.appearance.themeDark : window.siyuan.config.appearance.themeLight;
- if (window.siyuan.config.appearance.themeJS) {
- if (window.destroyTheme) {
- try {
- await window.destroyTheme();
- window.destroyTheme = undefined;
- document.getElementById("themeScript").remove();
- addScript(`/appearance/themes/${currentTheme}/theme.js?v=${response.data.appearance.themeVer}`, "themeScript");
- } catch (e) {
- console.error("destroyTheme error: " + e);
- }
- } else {
- exportLayout({
- cb() {
- window.location.reload();
- },
- errorExit: false,
- });
- return;
- }
- }
- if ((window.siyuan.config.appearance.mode === 1 && currentTheme === "midnight") ||
- (window.siyuan.config.appearance.mode !== 1 && currentTheme === "daylight")) {
- (document.getElementById("themeDefaultStyle") as HTMLLinkElement).href = `/appearance/themes/${window.siyuan.config.appearance.mode === 1 ? "midnight" : "daylight"}/theme.css?v=${Constants.SIYUAN_VERSION}`;
- } else {
- (document.getElementById("themeStyle") as HTMLLinkElement).href = `/appearance/themes/${currentTheme}/theme.css?v=${response.data.appearance.themeVer}`;
- }
- } else if (bazaarType === "plugins") {
+ if (bazaarType === "plugins") {
app.plugins.find((item: Plugin) => {
if (item.name === dataObj.name) {
reloadPlugin(app, {
@@ -838,7 +782,7 @@ export const bazaar = {
frontend: getFrontend()
}, response => {
this._genMyHTML(bazaarType, app);
- bazaar._onBazaar(response, bazaarType, ["themes", "icons"].includes(bazaarType));
+ bazaar._onBazaar(response, bazaarType);
});
});
}
@@ -856,9 +800,8 @@ export const bazaar = {
this._genMyHTML(bazaarType, app, false);
fetchPost("/api/bazaar/getBazaarIcon", {}, response => {
response.data.appearance = appearanceResponse.data;
- bazaar._onBazaar(response, "icons", true);
+ bazaar._onBazaar(response, "icons");
bazaar._data.icons = response.data.packages;
- reloadOtherWindow();
});
});
} else if (bazaarType === "themes") {
@@ -868,35 +811,10 @@ export const bazaar = {
themeDark: mode === 1 ? packageName : window.siyuan.config.appearance.themeDark,
themeLight: mode === 0 ? packageName : window.siyuan.config.appearance.themeLight,
}), async (appearanceResponse) => {
- reloadOtherWindow();
- if ((mode !== window.siyuan.config.appearance.mode ||
- (mode === 1 && window.siyuan.config.appearance.themeDark !== packageName) ||
- (mode === 0 && window.siyuan.config.appearance.themeLight !== packageName)) &&
- window.siyuan.config.appearance.themeJS) {
- if (window.destroyTheme) {
- try {
- await window.destroyTheme();
- window.destroyTheme = undefined;
- document.getElementById("themeScript").remove();
- } catch (e) {
- console.error("destroyTheme error: " + e);
- }
- window.siyuan.config.appearance = appearanceResponse.data;
- loadAssets(window.siyuan.config.appearance);
- } else {
- exportLayout({
- cb() {
- window.location.reload();
- },
- errorExit: false,
- });
- return;
- }
- }
this._genMyHTML("themes", app, false);
fetchPost("/api/bazaar/getBazaarTheme", {}, response => {
response.data.appearance = appearanceResponse.data;
- bazaar._onBazaar(response, "themes", true);
+ bazaar._onBazaar(response, "themes");
bazaar._data.themes = response.data.packages;
});
});
@@ -993,29 +911,29 @@ export const bazaar = {
if (!item.getAttribute("data-init")) {
if (type === "template") {
fetchPost("/api/bazaar/getBazaarTemplate", {}, response => {
- bazaar._onBazaar(response, "templates", false);
+ bazaar._onBazaar(response, "templates");
bazaar._data.templates = response.data.packages;
});
} else if (type === "icon") {
fetchPost("/api/bazaar/getBazaarIcon", {}, response => {
- bazaar._onBazaar(response, "icons", false);
+ bazaar._onBazaar(response, "icons");
bazaar._data.icons = response.data.packages;
});
} else if (type === "widget") {
fetchPost("/api/bazaar/getBazaarWidget", {}, response => {
- bazaar._onBazaar(response, "widgets", false);
+ bazaar._onBazaar(response, "widgets");
bazaar._data.widgets = response.data.packages;
});
} else if (type === "theme") {
fetchPost("/api/bazaar/getBazaarTheme", {}, response => {
- bazaar._onBazaar(response, "themes", false);
+ bazaar._onBazaar(response, "themes");
bazaar._data.themes = response.data.packages;
});
} else if (type === "plugin") {
fetchPost("/api/bazaar/getBazaarPlugin", {
frontend: getFrontend()
}, response => {
- bazaar._onBazaar(response, "plugins", false);
+ bazaar._onBazaar(response, "plugins");
bazaar._data.plugins = response.data.packages;
});
}
@@ -1048,22 +966,22 @@ export const bazaar = {
const type = (hasClosestByClassName(inputElement, "config-bazaar__panel") as HTMLElement).getAttribute("data-type");
if (type === "template") {
fetchPost("/api/bazaar/getBazaarTemplate", {keyword}, response => {
- bazaar._onBazaar(response, "templates", false);
+ bazaar._onBazaar(response, "templates");
bazaar._data.templates = response.data.packages;
});
} else if (type === "icon") {
fetchPost("/api/bazaar/getBazaarIcon", {keyword}, response => {
- bazaar._onBazaar(response, "icons", false);
+ bazaar._onBazaar(response, "icons");
bazaar._data.icons = response.data.packages;
});
} else if (type === "widget") {
fetchPost("/api/bazaar/getBazaarWidget", {keyword}, response => {
- bazaar._onBazaar(response, "widgets", false);
+ bazaar._onBazaar(response, "widgets");
bazaar._data.widgets = response.data.packages;
});
} else if (type === "theme") {
fetchPost("/api/bazaar/getBazaarTheme", {keyword}, response => {
- bazaar._onBazaar(response, "themes", false);
+ bazaar._onBazaar(response, "themes");
bazaar._data.themes = response.data.packages;
});
} else if (type === "plugin") {
@@ -1071,7 +989,7 @@ export const bazaar = {
frontend: getFrontend(),
keyword
}, response => {
- bazaar._onBazaar(response, "plugins", false);
+ bazaar._onBazaar(response, "plugins");
bazaar._data.plugins = response.data.packages;
});
} else if (type === "downloaded") {
@@ -1148,7 +1066,7 @@ export const bazaar = {
});
});
},
- _onBazaar(response: IWebSocketData, bazaarType: TBazaarType, reload: boolean) {
+ _onBazaar(response: IWebSocketData, bazaarType: TBazaarType) {
if (bazaar.element.querySelector("#configBazaarReadme").classList.contains("config-bazaar__readme--show")) {
const dataObj = JSON.parse(bazaar.element.querySelector("#configBazaarReadme > .item__side").getAttribute("data-obj"));
bazaar._renderReadme((dataObj.bazaarType) as TBazaarType,
@@ -1206,8 +1124,5 @@ export const bazaar = {
html += '';
}
element.innerHTML = `${html}
`;
- if (reload) {
- appearance.onSetAppearance(response.data.appearance);
- }
}
};
diff --git a/app/src/config/keymap.ts b/app/src/config/keymap.ts
index 4f2de5961..0f79661b7 100644
--- a/app/src/config/keymap.ts
+++ b/app/src/config/keymap.ts
@@ -143,7 +143,7 @@ export const keymap = {