Skip to content

Commit 2bf25ce

Browse files
committed
Merge branch 'release/3.68.0'
2 parents 77bb23c + 8cc3483 commit 2bf25ce

File tree

15 files changed

+198
-182
lines changed

15 files changed

+198
-182
lines changed

README.md

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -76,23 +76,18 @@ For more information on how to use the following functions, please see [characte
7676

7777
## Changelogs
7878

79-
### [v3.67.1](https://github.com/purocean/yn/releases/tag/v3.67.1) 2024-01-30
80-
81-
[Windows](https://github.com/purocean/yn/releases/download/v3.67.1/Yank-Note-win-x64-3.67.1.exe) | [macOS arm64](https://github.com/purocean/yn/releases/download/v3.67.1/Yank-Note-mac-arm64-3.67.1.dmg) | [macOS x64](https://github.com/purocean/yn/releases/download/v3.67.1/Yank-Note-mac-x64-3.67.1.dmg) | [Linux AppImage](https://github.com/purocean/yn/releases/download/v3.67.1/Yank-Note-linux-x86_64-3.67.1.AppImage) | [Linux deb](https://github.com/purocean/yn/releases/download/v3.67.1/Yank-Note-linux-amd64-3.67.1.deb)
82-
83-
1. feat: Add "Services" menu on macOS
84-
2. feat: Add HTML file preview functionality
85-
3. feat: Allow parsing of Markdown `style` tags
86-
4. feat: Support Vue code block highlighting in the editor (HTML mode)
87-
5. fix: Fix slight performance degradation in Markdown rendering after introducing custom editor
88-
6. fix: Fix caching issue with updated images
89-
7. fix: Fix potential unresponsiveness of built-in terminal to window size changes
90-
8. fix: Fix incorrect indentation of Python code in terminal execution
91-
9. fix: Fix editor loading issue when opening files supported by custom editor
92-
10. fix: Fix correct path retrieval when opening files from the system
93-
11. feat(plugin): Support registering custom renderer `ctx.renderer.registerRenderer`
94-
12. refactor(plugin): Rename `ctx.api.watchFile` to `ctx.api.watchFs`
95-
13. refactor(plugin): Rename `ctx.markdown.getRenderCache` to `ctx.renderer.getRenderCache`
79+
### [v3.68.0](https://github.com/purocean/yn/releases/tag/v3.68.0) 2024-04-23
80+
81+
[Windows](https://github.com/purocean/yn/releases/download/v3.68.0/Yank-Note-win-x64-3.68.0.exe) | [macOS arm64](https://github.com/purocean/yn/releases/download/v3.68.0/Yank-Note-mac-arm64-3.68.0.dmg) | [macOS x64](https://github.com/purocean/yn/releases/download/v3.68.0/Yank-Note-mac-x64-3.68.0.dmg) | [Linux AppImage](https://github.com/purocean/yn/releases/download/v3.68.0/Yank-Note-linux-x86_64-3.68.0.AppImage) | [Linux deb](https://github.com/purocean/yn/releases/download/v3.68.0/Yank-Note-linux-amd64-3.68.0.deb)
82+
83+
1. feat: Added the feature to focus on the currently open document in the sidebar
84+
2. feat: Optimized the background color for dark theme image previews
85+
3. fix: Fixed the issue where the Luckysheet editing dialog could not be operated
86+
4. fix: Fixed the issue where the document may not be closed after enabling auto-save
87+
5. chore: Upgraded markdown-it to 14.1.0
88+
6. chore: Upgraded Monaco editor to 0.47.0
89+
7. chore: Upgraded viewerjs to 1.11.6
90+
8. chore: Upgraded katex to 0.16.10
9691

9792
[More release notes](https://github.com/purocean/yn/releases)
9893

README_ZH-CN.md

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -76,23 +76,18 @@
7676

7777
## 更新日志
7878

79-
### [v3.67.1](https://github.com/purocean/yn/releases/tag/v3.67.1) 2024-01-30
80-
81-
[Windows](https://github.com/purocean/yn/releases/download/v3.67.1/Yank-Note-win-x64-3.67.1.exe) | [macOS arm64](https://github.com/purocean/yn/releases/download/v3.67.1/Yank-Note-mac-arm64-3.67.1.dmg) | [macOS x64](https://github.com/purocean/yn/releases/download/v3.67.1/Yank-Note-mac-x64-3.67.1.dmg) | [Linux AppImage](https://github.com/purocean/yn/releases/download/v3.67.1/Yank-Note-linux-x86_64-3.67.1.AppImage) | [Linux deb](https://github.com/purocean/yn/releases/download/v3.67.1/Yank-Note-linux-amd64-3.67.1.deb)
82-
83-
1. feat: 在 macOS 上增加“服务”菜单
84-
2. feat: 增加 HTML 文件预览功能
85-
3. feat: 放开 Markdown `style` 标签解析
86-
4. feat: 编辑器中支持 Vue 代码块高亮(HTML模式)
87-
5. fix: 修复引入自定义编辑器后 Markdown 渲染性能轻微退化
88-
6. fix: 修复图片更新后,图片被缓存的问题
89-
7. fix: 修复内置终端可能不能响应窗口尺寸变化问题
90-
8. fix: 修复终端运行 python 代码缩进不正确问题
91-
9. fix: 修复打开自定义编辑器支持的文件,可能编辑器加载异常问题
92-
10. fix: 修复从系统中打开文件,路径获取正确问题
93-
11. feat(plugin): 支持注册自定义渲染器 `ctx.renderer.registerRenderer`
94-
12. refactor(plugin): `ctx.api.watchFile` 被命名为 `ctx.api.watchFs`
95-
13. refactor(plugin): `ctx.markdown.getRenderCache` 被命名为 `ctx.renderer.getRenderCache`
79+
### [v3.68.0](https://github.com/purocean/yn/releases/tag/v3.68.0) 2024-04-23
80+
81+
[Windows](https://github.com/purocean/yn/releases/download/v3.68.0/Yank-Note-win-x64-3.68.0.exe) | [macOS arm64](https://github.com/purocean/yn/releases/download/v3.68.0/Yank-Note-mac-arm64-3.68.0.dmg) | [macOS x64](https://github.com/purocean/yn/releases/download/v3.68.0/Yank-Note-mac-x64-3.68.0.dmg) | [Linux AppImage](https://github.com/purocean/yn/releases/download/v3.68.0/Yank-Note-linux-x86_64-3.68.0.AppImage) | [Linux deb](https://github.com/purocean/yn/releases/download/v3.68.0/Yank-Note-linux-amd64-3.68.0.deb)
82+
83+
1. feat: 增加在侧栏中聚焦当前打开文档的功能
84+
2. feat: 优化暗色主题图片预览背景色
85+
3. fix: 修复 Luckysheet 编辑弹窗无法操作问题
86+
4. fix: 修复开启自动保存后,可能不能关闭文档的问题
87+
5. chore: 升级 markdown-it 到 14.1.0
88+
6. chore: 升级 Monaco editor 到 0.47.0
89+
7. chore: 升级 viewerjs 到 1.11.6
90+
8. chore: 升级 katex 到 0.16.10
9691

9792
[更多发布说明](https://github.com/purocean/yn/releases)
9893

package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "yank.note",
3-
"version": "3.67.1",
3+
"version": "3.68.0",
44
"description": "Yank Note: A highly extensible Markdown editor, designed for productivity.",
55
"main": "dist/main/app.js",
66
"license": "AGPL-3.0",
@@ -40,7 +40,7 @@
4040
"glob": "^8.0.3",
4141
"http-proxy-agent": "^5.0.0",
4242
"https-proxy-agent": "^5.0.0",
43-
"ip": "^1.1.5",
43+
"ip": "^1.1.9",
4444
"jsonrpc-bridge": "^0.0.4",
4545
"jsonwebtoken": "^9.0.0",
4646
"koa": "^2.13.1",
@@ -121,19 +121,19 @@
121121
"jest-extended": "^1.2.0",
122122
"js-untar": "^2.0.0",
123123
"juice": "^8.0.0",
124-
"katex": "^0.16.4",
124+
"katex": "^0.16.10",
125125
"lodash-es": "^4.17.21",
126-
"markdown-it": "^13.0.1",
127-
"markdown-it-abbr": "^1.0.4",
126+
"markdown-it": "^14.1.0",
127+
"markdown-it-abbr": "^2.0.0",
128128
"markdown-it-attributes": "^1.1.1",
129-
"markdown-it-container": "^3.0.0",
130-
"markdown-it-emoji": "^2.0.2",
131-
"markdown-it-github-alerts": "^0.1.2",
132-
"markdown-it-mark": "^3.0.1",
129+
"markdown-it-container": "^4.0.0",
130+
"markdown-it-emoji": "^3.0.0",
131+
"markdown-it-github-alerts": "^0.3.0",
132+
"markdown-it-mark": "^4.0.0",
133133
"markdown-it-multimd-table": "^4.2.3",
134-
"markdown-it-sub": "^1.0.0",
135-
"markdown-it-sup": "^1.0.0",
136-
"monaco-editor": "^0.41.0",
134+
"markdown-it-sub": "^2.0.0",
135+
"markdown-it-sup": "^2.0.0",
136+
"monaco-editor": "^0.47.0",
137137
"normalize.css": "^8.0.1",
138138
"parse-author": "^2.0.0",
139139
"path-browserify": "^1.0.1",
@@ -147,8 +147,8 @@
147147
"typedoc": "^0.25.4",
148148
"typescript": "^4.9.5",
149149
"utility-types": "^3.10.0",
150-
"viewerjs": "^1.11.0",
151-
"vite": "^4.5.2",
150+
"viewerjs": "^1.11.6",
151+
"vite": "^4.5.3",
152152
"vue": "^3.3.13",
153153
"vue-router": "^4.0.0-0",
154154
"vue-tsc": "^1.8.26",

src/renderer/components/Mask.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,4 +127,9 @@ export default defineComponent({
127127
.fade-enter, .fade-leave-to {
128128
opacity: 0;
129129
}
130+
131+
.content {
132+
position: relative;
133+
z-index: 1;
134+
}
130135
</style>

src/renderer/components/Tree.vue

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
</template>
2121

2222
<script lang="ts">
23-
import { computed, defineComponent, onBeforeUnmount, ref, watch } from 'vue'
23+
import { computed, defineComponent, nextTick, onBeforeUnmount, ref, watch } from 'vue'
2424
import { useLazyRef } from '@fe/utils/composable'
2525
import { useContextMenu } from '@fe/support/ui/context-menu'
2626
import { refreshTree } from '@fe/services/tree'
@@ -80,8 +80,14 @@ export default defineComponent({
8080
}
8181
8282
function revealCurrentNode () {
83-
const currentNode = asideRef.value?.querySelector('.tree-node > .name.selected')
84-
currentNode?.scrollIntoView({ block: 'center' })
83+
asideRef.value?.querySelectorAll('details[data-should-open="true"]').forEach((el: any) => {
84+
el.open = true
85+
})
86+
87+
nextTick(() => {
88+
const currentNode = asideRef.value?.querySelector('.tree-node > .name.selected')
89+
currentNode?.scrollIntoView({ block: 'center' })
90+
})
8591
}
8692
8793
watch(currentRepo, refreshTree, { immediate: true })

src/renderer/components/TreeNode.vue

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
:open="open"
88
:data-count="itemNode.children?.length"
99
:data-level="itemNode.level"
10+
:data-should-open="shouldOpen"
1011
@toggle="(e: any) => open = e.target.open"
1112
@dragenter="onDragEnter"
1213
@dragover="onDragOver"
@@ -309,7 +310,12 @@ export default defineComponent({
309310
})
310311
311312
const shouldOpen = computed(() => {
312-
return itemNode.value.type === 'dir' && currentFile.value && currentFile.value.path.startsWith(itemNode.value.path + '/') && currentFile.value.repo === itemNode.value.repo
313+
if (itemNode.value.type === 'dir' && currentFile.value) {
314+
// open the folder when the file is in the folder
315+
return itemNode.value.path === '/' || (currentFile.value.path.startsWith(itemNode.value.path + '/') && currentFile.value.repo === itemNode.value.repo)
316+
}
317+
318+
return false
313319
})
314320
315321
const marked = computed(() => localMarked.value ?? itemNode.value.marked)
@@ -354,6 +360,7 @@ export default defineComponent({
354360
onDragExit,
355361
onDrop,
356362
onDragStart,
363+
shouldOpen,
357364
isMarkdownFile,
358365
FLAG_READONLY,
359366
}

src/renderer/plugins/emoji.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type * as Monaco from 'monaco-editor'
2-
import MarkdownItEmoji from 'markdown-it-emoji'
3-
import emoji from 'markdown-it-emoji/lib/data/full.json'
2+
import MarkdownItEmoji from 'markdown-it-emoji/dist/full.cjs.js'
3+
import emoji from 'markdown-it-emoji/lib/data/full.mjs'
44
import type { Ctx, Plugin } from '@fe/context'
55

66
const triggerCharacter = ':'

src/renderer/plugins/image-viewer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export default {
129129

130130
ctx.theme.addStyles(`
131131
body .viewer-backdrop {
132-
background: rgba(239, 239, 239, 0.98);
132+
background: rgba(var(--g-color-90-rgb), 0.98);
133133
}
134134
135135
body .viewer-title {

src/renderer/plugins/status-bar-navigation.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ export default {
1717
ellipsis: true,
1818
onClick: () => ctx.action.getActionHandler('workbench.show-quick-open')()
1919
},
20+
{
21+
id: 'reveal-current-file-in-sidebar',
22+
hidden: ctx.store.state.currentRepo?.name !== ctx.store.state.currentFile?.repo,
23+
type: 'normal',
24+
title: ctx.i18n.t('status-bar.nav.reveal-current-file-in-sidebar'),
25+
subTitle: ctx.keybinding.getKeysLabel('tree.reveal-current-node'),
26+
ellipsis: false,
27+
onClick: () => ctx.action.getActionHandler('tree.reveal-current-node')()
28+
},
2029
{ type: 'separator' },
2130
]
2231
}

src/renderer/services/document.ts

Lines changed: 36 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -559,36 +559,45 @@ export async function ensureCurrentFileSaved () {
559559
try {
560560
const autoSave = !isEncrypted(currentFile) && getSetting('auto-save', 2000)
561561
if (autoSave) {
562-
await saveContent()
563-
} else {
564-
const confirm = await useModal().confirm({
565-
title: t('save-check-dialog.title'),
566-
content: t('save-check-dialog.desc'),
567-
action: h(Fragment, [
568-
h('button', {
569-
onClick: async () => {
570-
await saveContent()
571-
useModal().ok()
572-
}
573-
}, t('save')),
574-
h('button', {
575-
onClick: () => useModal().ok()
576-
}, t('discard')),
577-
h('button', {
578-
onClick: () => useModal().cancel()
579-
}, t('cancel')),
580-
])
581-
})
562+
try {
563+
await saveContent()
564+
return
565+
} catch (error: any) {
566+
useToast().show('warning', error.message)
567+
}
568+
}
582569

583-
checkFile()
570+
const confirm = await useModal().confirm({
571+
title: t('save-check-dialog.title'),
572+
content: t('save-check-dialog.desc'),
573+
action: h(Fragment, [
574+
h('button', {
575+
onClick: async () => {
576+
await saveContent().catch(error => {
577+
useToast().show('warning', error.message)
578+
throw error
579+
})
580+
581+
useModal().ok()
582+
}
583+
}, t('save')),
584+
h('button', {
585+
onClick: () => useModal().ok()
586+
}, t('discard')),
587+
h('button', {
588+
onClick: () => useModal().cancel()
589+
}, t('cancel')),
590+
])
591+
})
584592

585-
if (confirm) {
586-
if (!store.getters.isSaved && currentFile.content) {
587-
store.state.currentContent = currentFile.content!
588-
}
589-
} else {
590-
throw new Error('Document not saved')
593+
checkFile()
594+
595+
if (confirm) {
596+
if (!store.getters.isSaved && currentFile.content) {
597+
store.state.currentContent = currentFile.content!
591598
}
599+
} else {
600+
throw new Error('Document not saved')
592601
}
593602
} catch (error: any) {
594603
useToast().show('warning', error.message)

src/renderer/services/editor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export const getDefaultOptions = (): Monaco.editor.IStandaloneEditorConstruction
8888
lineNumbers: getSetting('editor.line-numbers', 'on'),
8989
quickSuggestions: getSetting('editor.quick-suggestions', false),
9090
suggestOnTriggerCharacters: getSetting('editor.suggest-on-trigger-characters', true),
91-
occurrencesHighlight: false,
91+
occurrencesHighlight: 'off',
9292
renderLineHighlight: 'all',
9393
wordSeparators: '`~!@#$%^&*()-=+[{]}\\|;:\'",.<>/?。?!,、;:“”‘’()《》〈〉【】『』「」﹃﹄〔〕'
9494
})

src/renderer/shims-vue.d.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ declare module 'markdown-it-task-lists'
1313
declare module 'markdown-it-attrs'
1414
declare module 'markdown-it-multimd-table'
1515
declare module 'markdown-it-katex'
16-
declare module 'markdown-it-emoji'
16+
declare module 'markdown-it-emoji/dist/full.cjs.js'
17+
declare module 'markdown-it-emoji/lib/data/full.mjs'
1718
declare module '@json-editor/json-editor'
1819
declare module 'monaco-editor/esm/vs/basic-languages/markdown/markdown.js'
1920
declare module 'monaco-editor/esm/vs/editor/contrib/folding/indentRangeProvider.js'

src/share/i18n/languages/en.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ const data = {
230230
'nav': {
231231
'nav': 'Navigation',
232232
'goto': 'Goto',
233+
'reveal-current-file-in-sidebar': 'Reveal Current File in Sidebar',
233234
'forward': 'Forward',
234235
'back': 'Back',
235236
},

src/share/i18n/languages/zh-CN.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ const data: BaseLanguage = {
231231
'nav': {
232232
'nav': '导航',
233233
'goto': '快速跳转',
234+
'reveal-current-file-in-sidebar': '在侧栏中显示当前文件',
234235
'forward': '前进',
235236
'back': '后退',
236237
},

0 commit comments

Comments
 (0)