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

This commit is contained in:
Vanessa 2023-04-14 22:26:52 +08:00
commit 7557c77b9f
12 changed files with 352 additions and 31 deletions

View file

@ -1,4 +1,4 @@
* [ ] Please commit to the dev branch 请提交到 dev 开发分支
* [ ] For contributing new features, please supplement and improve the corresponding user guide documents 对于贡献新特性,请补充完善对应用户指南文档
* [ ] For bug fixes, please describe the problem and solution via code comments 对于修复缺陷,请通过代码注释描述问题和解决方案
* [ ] For text improvements (such as typos and wording adjustments), please submit directly 对于文案改进(比如错别字措辞调整)请直接提交
* [ ] Please commit to the dev branch
* [ ] For contributing new features, please supplement and improve the corresponding user guide documents
* [ ] For bug fixes, please describe the problem and solution via code comments
* [ ] For text improvements (such as typos and wording adjustments), please submit directly

10
.github/SECURITY.md vendored
View file

@ -1,12 +1,8 @@
# 安全报告 Security report
# Security report
如果你发现安全相关漏洞请通过如下任意一种方式告知我们:\
If you find security-related vulnerabilities, please inform us in any of the following ways:
* 直接开 Issue请隐去站点、实际项目等敏感信息\
Open Issue directly (please hide sensitive information such as site and actual project)
* 发邮件至 845765@qq.com\
Send an email to 845765@qq.com
* Open Issue directly (please hide sensitive information such as site and actual project)
* Send an email to 845765@qq.com
非常感谢!\
Thank you very much!

View file

@ -1,4 +1,6 @@
{
"ocrResult": "OCR result text",
"reOCR": "Re OCR",
"continueReview1": "Continue Review",
"continueReview2": "There are still <code class='fn__code'>${count}</code> cards to review, continue?",
"whatsNewInSiYuan": "What's New in SiYuan",

View file

@ -1,4 +1,7 @@
{
"ocrResult": "Texte du résultat OCR",
"ocrResult": "Texto de resultado de OCR",
"reOCR": "Re-OCR",
"continueReview1": "Continuar revisión",
"continueReview2": "Todavía hay tarjetas <code class='fn__code'>${count}</code> para revisar, ¿continuar?",
"whatsNewInSiYuan": "Novedades en SiYuan",

View file

@ -1,4 +1,5 @@
{
"reOCR": "ReOCR",
"continueReview1": "Continuer la révision",
"continueReview2": "Il reste encore des fiches <code class='fn__code'>${count}</code> à examiner, continuer ?",
"whatsNewInSiYuan": "Quoi de neuf dans SiYuan",

View file

@ -1,4 +1,6 @@
{
"ocrResult": "OCR 結果文本",
"reOCR": "重新 OCR",
"continueReview1": "繼續複習",
"continueReview2": "還有 <code class='fn__code'>${count}</code> 張卡片待複習,是否繼續?",
"whatsNewInSiYuan": "思源筆記最新變化",

View file

@ -1,4 +1,6 @@
{
"ocrResult": "OCR 结果文本",
"reOCR": "重新 OCR",
"continueReview1": "继续复习",
"continueReview2": "还有 <code class='fn__code'>${count}</code> 张卡片待复习,是否继续?",
"whatsNewInSiYuan": "思源笔记最新变化",

View file

@ -6,7 +6,7 @@
"id": "20200924100744-br924ar",
"title": "Assets",
"type": "doc",
"updated": "20230211103249"
"updated": "20230414203046"
},
"Children": [
{
@ -981,11 +981,26 @@
]
},
{
"ID": "20230117003636-iel5zll",
"ID": "20230414202934-1h96or8",
"Type": "NodeHeading",
"HeadingLevel": 3,
"Properties": {
"id": "20230414202934-1h96or8",
"updated": "20230414202934"
},
"Children": [
{
"Type": "NodeText",
"Data": "Manually adjust OCR results"
}
]
},
{
"ID": "20230414203027-6py4l9z",
"Type": "NodeParagraph",
"Properties": {
"id": "20230117003636-iel5zll",
"updated": "20230117003842"
"id": "20230414203027-6py4l9z",
"updated": "20230414203027"
},
"Children": [
{
@ -999,7 +1014,97 @@
},
{
"Type": "NodeText",
"Data": ". If you need to re-OCR or adjust the extraction results, you can delete or modify this file when SiYuan is closed, and manually rebuild the index after starting SiYuan."
"Data": ", and the OCR results can be adjusted in the following ways:"
}
]
},
{
"ID": "20230414203027-ga8zni5",
"Type": "NodeList",
"ListData": {},
"Properties": {
"id": "20230414203027-ga8zni5",
"updated": "20230414203046"
},
"Children": [
{
"ID": "20230414203027-n8cc4ra",
"Type": "NodeListItem",
"ListData": {
"BulletChar": 42,
"Marker": "Kg=="
},
"Properties": {
"id": "20230414203027-n8cc4ra",
"updated": "20230414203036"
},
"Children": [
{
"ID": "20230414203027-epcrauz",
"Type": "NodeParagraph",
"Properties": {
"id": "20230414203027-epcrauz",
"updated": "20230414203036"
},
"Children": [
{
"Type": "NodeText",
"Data": "After exiting SiYuan, modify the file on the file system (please pay attention to the correctness of the JSON format)"
}
]
}
]
},
{
"ID": "20230414203027-zdq3yuf",
"Type": "NodeListItem",
"ListData": {
"BulletChar": 42,
"Marker": "Kg=="
},
"Properties": {
"id": "20230414203027-zdq3yuf",
"updated": "20230414203046"
},
"Children": [
{
"ID": "20230414203027-ouvsa2g",
"Type": "NodeParagraph",
"Properties": {
"id": "20230414203027-ouvsa2g",
"updated": "20230414203046"
},
"Children": [
{
"Type": "NodeText",
"Data": "Or select "
},
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "OCR"
},
{
"Type": "NodeText",
"Data": " from the image element menu in the editor"
}
]
}
]
}
]
},
{
"ID": "20230414203027-chylp3d",
"Type": "NodeParagraph",
"Properties": {
"id": "20230414203027-chylp3d",
"updated": "20230414203027"
},
"Children": [
{
"Type": "NodeText",
"Data": "After the adjustment, you need to manually rebuild the index."
}
]
}

View file

@ -6,7 +6,7 @@
"id": "20200915214115-42b8zma",
"title": "资源文件",
"type": "doc",
"updated": "20230211103308"
"updated": "20230414203014"
},
"Children": [
{
@ -199,7 +199,7 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20210512171633-u3iy2xx",
"updated": "20220824172745"
"updated": "20230414202246"
},
"Children": [
{
@ -1007,12 +1007,27 @@
}
]
},
{
"ID": "20230414202710-a51lo76",
"Type": "NodeHeading",
"HeadingLevel": 3,
"Properties": {
"id": "20230414202710-a51lo76",
"updated": "20230414202726"
},
"Children": [
{
"Type": "NodeText",
"Data": "手动调整 OCR 结果"
}
]
},
{
"ID": "20230117003118-da7wjvx",
"Type": "NodeParagraph",
"Properties": {
"id": "20230117003118-da7wjvx",
"updated": "20230117003434"
"updated": "20230414202825"
},
"Children": [
{
@ -1026,7 +1041,97 @@
},
{
"Type": "NodeText",
"Data": " 中,如果需要重新 OCR 或者调整提取结果,可以在关闭思源的情况下删除或修改该文件,启动思源以后手动重建索引。"
"Data": " 中,可通过下面的方式调整 OCR 结果:"
}
]
},
{
"ID": "20230414202215-wv6v759",
"Type": "NodeList",
"ListData": {},
"Properties": {
"id": "20230414202215-wv6v759",
"updated": "20230414203014"
},
"Children": [
{
"ID": "20230414202216-6ib46sp",
"Type": "NodeListItem",
"ListData": {
"BulletChar": 42,
"Marker": "Kg=="
},
"Properties": {
"id": "20230414202216-6ib46sp",
"updated": "20230414203014"
},
"Children": [
{
"ID": "20230414202216-7lh8lft",
"Type": "NodeParagraph",
"Properties": {
"id": "20230414202216-7lh8lft",
"updated": "20230414203014"
},
"Children": [
{
"Type": "NodeText",
"Data": "退出思源后下在文件系统上修改该文件(请注意 JSON 格式的正确性)"
}
]
}
]
},
{
"ID": "20230414202222-wbxjz0f",
"Type": "NodeListItem",
"ListData": {
"BulletChar": 42,
"Marker": "Kg=="
},
"Properties": {
"id": "20230414202222-wbxjz0f",
"updated": "20230414202849"
},
"Children": [
{
"ID": "20230414202222-oelakfd",
"Type": "NodeParagraph",
"Properties": {
"id": "20230414202222-oelakfd",
"updated": "20230414202849"
},
"Children": [
{
"Type": "NodeText",
"Data": "或者在编辑器中的图片元素菜单中选择 "
},
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "OCR"
},
{
"Type": "NodeText",
"Data": ""
}
]
}
]
}
]
},
{
"ID": "20230414202749-qbcnypq",
"Type": "NodeParagraph",
"Properties": {
"id": "20230414202749-qbcnypq",
"updated": "20230414202900"
},
"Children": [
{
"Type": "NodeText",
"Data": "调整完以后需要手动重建索引。"
}
]
}

View file

@ -5,7 +5,7 @@
"Properties": {
"id": "20211226123038-4umgpxy",
"title": "資料文件",
"updated": "20230211103259"
"updated": "20230414203110"
},
"Children": [
{
@ -986,11 +986,26 @@
]
},
{
"ID": "20230117003901-ds4ok9s",
"ID": "20230414203058-foirrwk",
"Type": "NodeHeading",
"HeadingLevel": 3,
"Properties": {
"id": "20230414203058-foirrwk",
"updated": "20230414203058"
},
"Children": [
{
"Type": "NodeText",
"Data": "手動調整 OCR 結果"
}
]
},
{
"ID": "20230414203058-td34ii9",
"Type": "NodeParagraph",
"Properties": {
"id": "20230117003901-ds4ok9s",
"updated": "20230117003901"
"id": "20230414203058-td34ii9",
"updated": "20230414203058"
},
"Children": [
{
@ -1004,7 +1019,97 @@
},
{
"Type": "NodeText",
"Data": " 中,如果需要重新 OCR 或者調整提取結果,可以在關閉思源的情況下刪除或修改該文件,啟動思源以後手動重建索引。"
"Data": " 中,可通過下面的方式調整 OCR 結果:"
}
]
},
{
"ID": "20230414203058-twp0v1x",
"Type": "NodeList",
"ListData": {},
"Properties": {
"id": "20230414203058-twp0v1x",
"updated": "20230414203110"
},
"Children": [
{
"ID": "20230414203058-bof05ob",
"Type": "NodeListItem",
"ListData": {
"BulletChar": 42,
"Marker": "Kg=="
},
"Properties": {
"id": "20230414203058-bof05ob",
"updated": "20230414203058"
},
"Children": [
{
"ID": "20230414203058-4t9mxdd",
"Type": "NodeParagraph",
"Properties": {
"id": "20230414203058-4t9mxdd",
"updated": "20230414203058"
},
"Children": [
{
"Type": "NodeText",
"Data": "退出思源後下在文件系統上修改該文件(請注意 JSON 格式的正確性)"
}
]
}
]
},
{
"ID": "20230414203058-hwxlrkd",
"Type": "NodeListItem",
"ListData": {
"BulletChar": 42,
"Marker": "Kg=="
},
"Properties": {
"id": "20230414203058-hwxlrkd",
"updated": "20230414203110"
},
"Children": [
{
"ID": "20230414203058-dn0g8im",
"Type": "NodeParagraph",
"Properties": {
"id": "20230414203058-dn0g8im",
"updated": "20230414203110"
},
"Children": [
{
"Type": "NodeText",
"Data": "或者在編輯器中的圖片元素菜單中選擇 "
},
{
"Type": "NodeTextMark",
"TextMarkType": "kbd",
"TextMarkTextContent": "OCR"
},
{
"Type": "NodeText",
"Data": ""
}
]
}
]
}
]
},
{
"ID": "20230414203058-pvk5pnz",
"Type": "NodeParagraph",
"Properties": {
"id": "20230414203058-pvk5pnz",
"updated": "20230414203058"
},
"Children": [
{
"Type": "NodeText",
"Data": "調整完以後需要手動重建索引。"
}
]
}

View file

@ -18,10 +18,10 @@
"build:export": "webpack --mode production --config webpack.export.js",
"start": "NODE_ENV=development electron ./electron/main.js",
"dist-appx": "ELECTRON_MIRROR=https://cnpmjs.org/mirrors/electron/ electron-builder --config electron-appx-builder.yml",
"dist": "ELECTRON_MIRROR=https://cnpmjs.org/mirrors/electron/ electron-builder --config electron-builder.yml",
"dist-darwin": "ELECTRON_MIRROR=https://cnpmjs.org/mirrors/electron/ electron-builder --mac --config electron-builder-darwin.yml",
"dist-darwin-arm64": "ELECTRON_MIRROR=https://cnpmjs.org/mirrors/electron/ electron-builder --arm64 --mac --config electron-builder-darwin-arm64.yml",
"dist-linux": "ELECTRON_MIRROR=https://cnpmjs.org/mirrors/electron/ electron-builder --linux --config electron-builder-linux.yml"
"dist": "ELECTRON_MIRROR=https://cnpmjs.org/mirrors/electron/ electron-builder --config electron-builder.yml --publish=never",
"dist-darwin": "ELECTRON_MIRROR=https://cnpmjs.org/mirrors/electron/ electron-builder --mac --config electron-builder-darwin.yml --publish=never",
"dist-darwin-arm64": "ELECTRON_MIRROR=https://cnpmjs.org/mirrors/electron/ electron-builder --arm64 --mac --config electron-builder-darwin-arm64.yml --publish=never",
"dist-linux": "ELECTRON_MIRROR=https://cnpmjs.org/mirrors/electron/ electron-builder --linux --config electron-builder-linux.yml --publish=never"
},
"keywords": [
"markdown",

View file

@ -593,7 +593,7 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme
label: "OCR",
submenu: [{
iconHTML: Constants.ZWSP,
label: window.siyuan.languages.refresh,
label: window.siyuan.languages.reOCR,
click() {
fetchPost("/api/asset/getImageOCRText", {
path: imgElement.getAttribute("src"),
@ -602,7 +602,7 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme
}
}, {
iconHTML: Constants.ZWSP,
label: `<div class="fn__hr--small"></div><textarea data-type="ocr" rows="1" class="b3-text-field fn__size200" placeholder="${window.siyuan.languages.update}"></textarea><div class="fn__hr--small"></div>`,
label: `<div class="fn__hr--small"></div><textarea data-type="ocr" rows="1" class="b3-text-field fn__size200" placeholder="${window.siyuan.languages.ocrResult}"></textarea><div class="fn__hr--small"></div>`,
bind(element) {
fetchPost("/api/asset/getImageOCRText", {
path: imgElement.getAttribute("src"),