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

This commit is contained in:
Vanessa 2022-10-01 23:12:38 +08:00
commit 4493649d0b
9 changed files with 37 additions and 33 deletions

View file

@ -14,10 +14,10 @@ Install pnpm: `npm install -g pnpm`
Set the Electron mirror environment variable and install Electron:
* macOS/Linux: `ELECTRON_MIRROR=https://cnpmjs.org/mirrors/electron/ pnpm install electron@20.1.4 -D`
* macOS/Linux: `ELECTRON_MIRROR=https://cnpmjs.org/mirrors/electron/ pnpm install electron@21.0.1 -D`
* Windows:
* `SET ELECTRON_MIRROR=https://cnpmjs.org/mirrors/electron/`
* `pnpm install electron@20.1.4 -D`
* `pnpm install electron@21.0.1 -D`
NPM mirror:
@ -28,7 +28,7 @@ NPM mirror:
On the desktop, go to the app folder to run:
* `pnpm install electron@20.1.4 -D`
* `pnpm install electron@21.0.1 -D`
* `pnpm run dev`
* `pnpm run start`

View file

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

View file

@ -84,10 +84,8 @@ try {
}
} catch (e) {
console.error(e)
require('electron').
dialog.
showErrorBox('创建配置目录失败 Failed to create config directory',
'思源需要在用户家目录下创建配置文件夹(~/.config/siyuan请确保该路径具有写入权限。\n\nSiYuan needs to create a configuration folder (~/.config/siyuan) in the user\'s home directory. Please make sure that the path has write permissions.')
require('electron').dialog.showErrorBox('创建配置目录失败 Failed to create config directory',
'思源需要在用户家目录下创建配置文件夹(~/.config/siyuan请确保该路径具有写入权限。\n\nSiYuan needs to create a configuration folder (~/.config/siyuan) in the user\'s home directory. Please make sure that the path has write permissions.')
app.exit()
}
@ -151,19 +149,25 @@ const boot = () => {
windowState.width = Math.min(defaultWidth, workArea.width)
windowState.height = Math.min(defaultHeight, workArea.height)
}
if (windowState.width < 256) {
windowState.width = Math.min(defaultWidth, workArea.width)
}
if (windowState.height < 256) {
windowState.height = Math.min(defaultHeight, workArea.height)
}
if (x > workArea.width || x < 0) {
if (x > workArea.width) {
x = 0
}
if (y > workArea.height || y < 0) {
if (y > workArea.height) {
y = 0
}
}
if (windowState.width < 400) {
windowState.width = 400
}
if (windowState.height < 300) {
windowState.height = 300
}
if (x < 0) {
x = 0
}
if (y < 0) {
y = 0
}
// 创建主窗体
mainWindow = new BrowserWindow({

View file

@ -59,7 +59,7 @@
"clean-webpack-plugin": "^4.0.0",
"css-loader": "^6.7.1",
"dayjs": "^1.11.5",
"electron": "20.1.4",
"electron": "21.0.1",
"electron-builder": "^23.3.3",
"encoding": "^0.1.13",
"eslint": "^8.19.0",

14
app/pnpm-lock.yaml generated
View file

@ -15,7 +15,7 @@ specifiers:
clean-webpack-plugin: ^4.0.0
css-loader: ^6.7.1
dayjs: ^1.11.5
electron: 20.1.4
electron: 21.0.1
electron-builder: ^23.3.3
electron-fetch: ^1.7.4
encoding: ^0.1.13
@ -39,7 +39,7 @@ specifiers:
webpack-cli: ^4.10.0
dependencies:
'@electron/remote': 2.0.8_electron@20.1.4
'@electron/remote': 2.0.8_electron@21.0.1
electron-fetch: 1.7.4
pnpm: 7.9.3
@ -57,7 +57,7 @@ devDependencies:
clean-webpack-plugin: 4.0.0_webpack@5.73.0
css-loader: 6.7.1_webpack@5.73.0
dayjs: 1.11.5
electron: 20.1.4
electron: 21.0.1
electron-builder: 23.3.3
encoding: 0.1.13
eslint: 8.19.0
@ -1274,12 +1274,12 @@ packages:
transitivePeerDependencies:
- supports-color
/@electron/remote/2.0.8_electron@20.1.4:
/@electron/remote/2.0.8_electron@21.0.1:
resolution: {integrity: sha512-P10v3+iFCIvEPeYzTWWGwwHmqWnjoh8RYnbtZAb3RlQefy4guagzIwcWtfftABIfm6JJTNQf4WPSKWZOpLmHXw==}
peerDependencies:
electron: '>= 13.0.0'
dependencies:
electron: 20.1.4
electron: 21.0.1
dev: false
/@electron/universal/1.2.1:
@ -2816,8 +2816,8 @@ packages:
resolution: {integrity: sha512-YoVeFrGd/7ROjz4R9uPoND1K/hSRC/xADy9639ZmIZeJSaBnKdYx3I6LMPsY7CXLpK7JFgKQVzeZ/dk2br6Eaw==}
dev: true
/electron/20.1.4:
resolution: {integrity: sha512-7ov5kgSQi2JewV5SrVfjGasUvyScjuJrrDCW0rYxtP2SMe3JjoP4rsOOnh3ps2P/Nrdlbv+0ygiK0zp4ARCZ+A==}
/electron/21.0.1:
resolution: {integrity: sha512-jLVSLakd0fO2GPnW4xXQrI93R464jeFb2ISngqRP3wpwH96XqeANkuAYLAr9TVhfQMCIWnuPROBZ+NU7nuk0WA==}
engines: {node: '>= 10.17.0'}
hasBin: true
requiresBuild: true

File diff suppressed because one or more lines are too long

View file

@ -290,6 +290,8 @@ func broadcastTransactions(transactions []*model.Transaction) {
}
func dataBlockDOM(data string, luteEngine *lute.Lute) (ret string) {
luteEngine.SetHTMLTag2TextMark(true) // API `/api/block/**` 无法使用 `<u>foo</u>` 与 `<kbd>bar</kbd>` 插入/更新行内元素 https://github.com/siyuan-note/siyuan/issues/6039
ret = luteEngine.Md2BlockDOM(data)
if "" == ret {
// 使用 API 插入空字符串出现错误 https://github.com/siyuan-note/siyuan/issues/3931

View file

@ -6,7 +6,7 @@ require (
github.com/88250/clipboard v0.1.5
github.com/88250/css v0.1.2
github.com/88250/gulu v1.2.3-0.20220929123404-da1dc91c9343
github.com/88250/lute v1.7.5-0.20221001045738-06a8c2407d65
github.com/88250/lute v1.7.5-0.20221001133424-66dae26ccb51
github.com/88250/pdfcpu v0.3.13
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1
github.com/ConradIrwin/font v0.0.0-20210318200717-ce8d41cc0732

View file

@ -17,10 +17,8 @@ github.com/88250/go-sqlite3 v1.14.13-0.20220714142610-fbbda1ee84f5 h1:8HdZozCsXS
github.com/88250/go-sqlite3 v1.14.13-0.20220714142610-fbbda1ee84f5/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
github.com/88250/gulu v1.2.3-0.20220929123404-da1dc91c9343 h1:GJxJRZmA8GkAiU3GswwsSszKqp1/aywhpyFJ+aC7J+k=
github.com/88250/gulu v1.2.3-0.20220929123404-da1dc91c9343/go.mod h1:I1qBzsksFL2ciGSuqDE7R3XW4BUMrfDgOvSXEk7FsAI=
github.com/88250/lute v1.7.5-0.20220928025238-bda91cbd4072 h1:0d7YXGtw2ybeGs6oClIFiKvTqySfJCu5SUdJJWil6MA=
github.com/88250/lute v1.7.5-0.20220928025238-bda91cbd4072/go.mod h1:cEoBGi0zArPqAsp0MdG9SKinvH/xxZZWXU7sRx8vHSA=
github.com/88250/lute v1.7.5-0.20221001045738-06a8c2407d65 h1:EyxFJkB2DXZrAzSaMPZhSs72NzEdsn4YNh/zmqat8IY=
github.com/88250/lute v1.7.5-0.20221001045738-06a8c2407d65/go.mod h1:cEoBGi0zArPqAsp0MdG9SKinvH/xxZZWXU7sRx8vHSA=
github.com/88250/lute v1.7.5-0.20221001133424-66dae26ccb51 h1:W3AfReSddAgkojmibncSHf01tm76nMcd11zivyj+ZIs=
github.com/88250/lute v1.7.5-0.20221001133424-66dae26ccb51/go.mod h1:cEoBGi0zArPqAsp0MdG9SKinvH/xxZZWXU7sRx8vHSA=
github.com/88250/pdfcpu v0.3.13 h1:touMWMZkCGalMIbEg9bxYp7rETM+zwb9hXjwhqi4I7Q=
github.com/88250/pdfcpu v0.3.13/go.mod h1:S5YT38L/GCjVjmB4PB84PymA1qfopjEhfhTNQilLpv4=
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1 h1:48T899JQDwyyRu9yXHePYlPdHtpJfrJEUGBMH3SMBWY=