Skip to content

Commit

Permalink
Merge branch 'release/3.27.0'
Browse files Browse the repository at this point in the history
purocean committed Mar 26, 2022
2 parents 7b6803d + e3130cb commit f6e5679
Showing 55 changed files with 1,270 additions and 202 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ jobs:
runs-on: ${{ matrix.os }}
env:
npm_config_disturl: https://atom.io/download/electron
npm_config_target: 15.3.2
npm_config_target: 15.4.1
npm_config_runtime: "electron"

steps:
43 changes: 19 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -90,30 +90,25 @@ For more information on how to use the following functions, please see [characte

## Changelogs

### [v3.26.0](https://github.com/purocean/yn/releases/tag/v3.26.0) 2022-03-12

1. feat: added image/link auto-completion for local path
2. feat: support to configure PlantUML endpoint, can configure the official online rendering endpoint of PlantUML
3. feat: support to configure automatic save interval
4. feat: Copy Content supports copying Markdown after processing images
5. feat: export HTML support more options
6. feat: Mermaid graphics support download PNG
7. upd: upgrade KaTeX version, support more syntax
8. fix: fix the problem of resetting the "sync rendering" state after switching files
9. fix: export: fix "Inline Images" may lose pictures
10. fix: export: fix the exported HTML KaTeX cannot be rendered correctly
11. fix: export: fix the exported Docx Mermaid graphics cannot be rendered correctly
12. fix: export: fix PlantUML cannot be exported
13. fix: export: fix the mind map of the exported document may be cropped
14. fix: fix the problem that some special character anchors cannot jump
15. feat(plugin): `ctx.ui.useModal` method supports custom action buttons
16. feat(plugin): `ctx.view.getRenderEnv` method adds `tokens` return field
17. feat(plugin): `VIEW_ON_GET_HTML_FILTER_NODE` hook adds `options.preferPng` parameter
18. feat(plugin): add `ctx.utils.removeQuery` method
19. feat(plugin): add `ctx.lib.mime` module
20. feat(plugin): add `ctx.lib.markdownit` module
21. feat(plugin): add `ctx.lib.domtoimage` module
22. feat(plugin): add `ctx.lib.pako` module
### [v3.27.0](https://github.com/purocean/yn/releases/tag/v3.27.0) 2022-03-26

1. feat: add outline display to the sidebar
2. feat: add action buttons to the sidebar
3. feat: add "include style" option to HTML export
4. feat: the editor adds syntax highlighting for LaTex, Mermaid, and macro expressions
5. feat: the editor adds reference link completion
6. feat: show detailed error message when Mermaid syntax is wrong
7. feat: add shortcut to close the current tab
8. feat: add shortcut to display "Copy Content" panel
9. upd: upgrade Electron to 15.4.1
10. upd: optimize code block display
11. upd: other interactive experience optimization
12. fix: fix the default positioning of the custom group container
13. fix: fix the problem that the bold anchor cannot jump
14. fix: fix some HTML export issues
15. feat(plugin): add `ctx.layout.toggleOutline` method
16. feat(plugin): add `ctx.view.getHeadings` method
17. feat(plugin): status bar menu supports custom order

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

43 changes: 19 additions & 24 deletions README_ZH-CN.md
Original file line number Diff line number Diff line change
@@ -90,30 +90,25 @@ V3 核心目标是重构代码,提升应用健壮性、可拓展性、Markdown

## 更新日志

### [v3.26.0](https://github.com/purocean/yn/releases/tag/v3.26.0) 2022-03-12

1. feat: 新增图片/链接本地路径自动补全
2. feat: 支持配置 PlantUML 端点,可配置 PlantUML 官方在线渲染地址
3. feat: 支持配置自动保存间隔
4. feat: 复制内容支持复制处理图片后的 Markdown
5. feat: 导出 HTML 支持更多选项
6. feat: Mermaid 图形支持下载 PNG 图片
7. upd: 升级 KaTeX 版本,支持更多公式语法
8. fix: 修复切换文件后重置“同步渲染”状态问题
9. fix: 导出:修复“内联图片”可能丢失图片问题
10. fix: 导出:修复导出 HTML 公式不能正确渲染问题
11. fix: 导出:修复导出 Docx Mermaid 图形不能正确渲染问题
12. fix: 导出:修复不能导出 PlantUML 问题
13. fix: 导出:修复导出文档脑图可能被裁切问题
14. fix: 修复一些特殊字符锚点不能跳转问题
15. feat(插件): `ctx.ui.useModal` 方法支持自定义操作按钮
16. feat(插件): `ctx.view.getRenderEnv` 方法增加 `tokens` 返回字段
17. feat(插件): `VIEW_ON_GET_HTML_FILTER_NODE` 钩子增加 `options.preferPng` 参数
18. feat(插件): 新增 `ctx.utils.removeQuery` 方法
19. feat(插件): 新增 `ctx.lib.mime` 模块
20. feat(插件): 新增 `ctx.lib.markdownit` 模块
21. feat(插件): 新增 `ctx.lib.domtoimage` 模块
22. feat(插件): 新增 `ctx.lib.pako` 模块
### [v3.27.0](https://github.com/purocean/yn/releases/tag/v3.27.0) 2022-03-26

1. feat: 侧栏增加目录大纲展示
2. feat: 侧栏增加操作按钮栏
3. feat: HTML 导出增加“包含样式”选项
4. feat: 编辑器增加 LaTex、Mermaid、宏表达式语法高亮
5. feat: 编辑器增加参考式链接补全
6. feat: Mermaid 语法错误时展示详细错误信息
7. feat: 增加关闭当前编辑 Tab 快捷键
8. feat: 增加展示“复制内容”面板快捷键
9. upd: 升级 Electron 版本到 15.4.1
10. upd: 优化代码块展示
11. upd: 其他交互体验优化
12. fix: 修复某些情况下自定义 Group 容器默认定位不正确
13. fix: 修复加粗锚点不能跳转问题
14. fix: 修复一些 HTML 导出问题
15. feat(plugin): 增加 `ctx.layout.toggleOutline` 方法
16. feat(plugin): 增加 `ctx.view.getHeadings` 方法
17. feat(plugin): 状态栏菜单支持自定义顺序

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

Binary file not shown.
1 change: 1 addition & 0 deletions help/FEATURES.md
Original file line number Diff line number Diff line change
@@ -76,6 +76,7 @@ This feature is implemented using [markdown-it-attrs](https://github.com/arve0/m
| `block` | The current element is displayed as a block element |
| `reduce-brightness` | Reduce the brightness of this element when using dark theme |
| `bgw` | Set current element background to white |
| `copy-inner-text` | Mark "Ctrl/Cmd + left click" to copy element text |

### Image Enhancement

1 change: 1 addition & 0 deletions help/FEATURES_ZH-CN.md
Original file line number Diff line number Diff line change
@@ -77,6 +77,7 @@ define:
| `block` | 当前元素显示为块元素 |
| `reduce-brightness` | 使用暗色主题时候降低此元素亮度 |
| `bgw` | 设置当前元素背景为白色 |
| `copy-inner-text` | 标记 “Ctrl/Cmd + 单击左键” 拷贝元素文字 |

### 图片增强

8 changes: 8 additions & 0 deletions help/SHORTCUTS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
---
enableMacro: true
define:
'Ctrl/Cmd': '[= $ctx.env.isMacOS ? "Cmd" : "Ctrl" =]'
'Alt/Option': '[= $ctx.env.isMacOS ? "Option" : "Alt" =]'
'TABS-CLOSE-CURRENT': '[= `${$ctx.env.isMacOS ? "Cmd" : "Ctrl"} +${$ctx.env.isElectron ? "" : ($ctx.env.isMacOS ? "Option" : "Alt") + " +"} W` =]'
---

## Shortcuts
@@ -43,11 +47,13 @@ Edit Table Cell | Double Click Cell
Edit Table Cell (Popup) | Ctrl/Cmd + Click
Copy Heading link | Ctrl/Cmd + Click Heading
Switch Editor Tab | Ctrl/Cmd + Alt/Option + Left/Right
Close Editor Current Tab | TABS-CLOSE-CURRENT
Toggle Sidebar | Alt/Option + E
Toggle Word Wrap | Alt/Option + W
Toggle Preview | Alt/Option + V
Toggle Terminal | Alt/Option + T
Toggle Control Center | Alt/Option + C
Show Copy Content Panel | Ctrl/Cmd + Shift + C
Presentation | F5
Zoom In | Ctrl/Cmd + =
Zoom Out | Ctrl/Cmd + -
@@ -91,11 +97,13 @@ Zoom Reset | Ctrl/Cmd + 0
编辑表格单元格(弹出框) | Ctrl/Cmd + 单击单元格
复制文档标题链接 | Ctrl/Cmd + 单击标题
切换编辑器 Tab | Ctrl/Cmd + Alt/Option + Left/Right
关闭编辑器当前标签 Tab | TABS-CLOSE-CURRENT
切换侧栏 | Alt/Option + E
切换编辑器自动换行 | Alt/Option + W
切换文档预览显示 | Alt/Option + V
切换终端 | Alt/Option + T
切换控制中心 | Alt/Option + C
展示复制面板 | Ctrl/Cmd + Shift + C
演示模式 | F5
缩放放大 | Ctrl/Cmd + =
缩放缩小 | Ctrl/Cmd + -
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yank.note",
"version": "3.26.0",
"version": "3.27.0",
"description": "Yank Note: A hackable markdown note application for programmers",
"main": "dist/main/app.js",
"license": "GPL-3.0",
@@ -86,7 +86,7 @@
"crypto-js": "^3.3.0",
"dom-to-image": "^2.6.0",
"echarts": "^5.2.2",
"electron": "15.3.2",
"electron": "15.4.1",
"electron-builder": "^22.14.5",
"electron-notarize": "^1.1.1",
"eslint": "^7.11.0",
2 changes: 1 addition & 1 deletion scripts/install.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
set npm_config_disturl=https://atom.io/download/electron
set npm_config_target=15.3.2
set npm_config_target=15.4.1
set npm_config_runtime="electron"

yarn install
2 changes: 1 addition & 1 deletion scripts/install.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh

export npm_config_disturl=https://atom.io/download/electron
export npm_config_target=15.3.2
export npm_config_target=15.4.1
export npm_config_runtime="electron"

yarn install
1 change: 0 additions & 1 deletion src/main/menus.ts
Original file line number Diff line number Diff line change
@@ -10,7 +10,6 @@ export const getMainMenus = () => process.platform === 'darwin' ? Menu.buildFrom
label: 'Application',
submenu: [
{ type: 'normal', label: $t('app.preferences'), click: () => getAction('show-main-window-setting')() },
{ type: 'normal', label: $t('app.close-window'), accelerator: 'Command+W', click: () => getAction('hide-main-window')() },
{ type: 'normal', label: $t('app.toggle-fullscreen'), accelerator: 'Ctrl+command+F', click: () => getAction('toggle-fullscreen')() },
{ type: 'normal', label: $t('app.quit'), accelerator: 'Command+Q', click: () => getAction('quit')() }
]
7 changes: 6 additions & 1 deletion src/main/shell.ts
Original file line number Diff line number Diff line change
@@ -28,11 +28,16 @@ const transformCdCommand = (command: string) => {
return `cd '${path.replace(/'/g, '\\\'')}'`
}

const shell = getShell()
// transform path for WSL shell.
if (getShell().indexOf('wsl.exe') > -1) {
if (shell.endsWith('wsl.exe')) {
return `cd '${toWslPath(path).replace(/'/g, '\\\'')}'`
}

if (shell.endsWith('powershell.exe')) {
return `cd '${path}'\r\n`
}

// change dir for Windows.
return `cd /d "${path}"\r`
}
141 changes: 141 additions & 0 deletions src/renderer/components/ActionBar.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
<template>
<div class="action-bar">
<div class="btns">
<div>
<div class="btn flat" @click="toggleOutline()" :title="$t(showOutline ? 'files' : 'outline')">
<svg-icon v-if="showOutline" name="folder-tree-solid" />
<svg-icon v-else name="list" />
</div>
</div>
</div>
<div class="title">{{$t(showOutline ? 'outline' : 'files')}}</div>
<div class="btns" v-if="navigation">
<div v-for="(item, i) in navigation.items" :key="i">
<div
v-if="item.showInActionBar && item.type === 'btn'"
:class="{ btn: true, flat: item.flat, disabled: item.disabled, checked: item.checked }"
:title="item.title"
@click.stop="item.onClick"
>
<svg-icon :name="item.icon" />
</div>
</div>
</div>
</div>
</template>

<script lang="ts" setup>
import { onBeforeUnmount, ref, toRef } from 'vue'
import { useStore } from 'vuex'
import { registerAction, removeAction } from '@fe/core/action'
import { getSchema, Schema } from '@fe/services/control-center'
import type { AppState } from '@fe/support/store'
import SvgIcon from './SvgIcon.vue'
import { useI18n } from '@fe/services/i18n'
import { toggleOutline } from '@fe/services/layout'
const store = useStore<AppState>()
const navigation = ref<Schema['navigation']>()
const showOutline = toRef(store.state, 'showOutline')
useI18n()
registerAction({
name: 'action-bar.refresh',
handler () {
navigation.value = getSchema().navigation
}
})
onBeforeUnmount(() => {
removeAction('action-bar.refresh')
})
</script>

<style lang="scss" scoped>
@import '@fe/styles/mixins.scss';
.action-bar {
height: 30px;
flex: none;
border-bottom: 1px solid var(--g-color-87);
z-index: 1;
display: flex;
justify-content: space-between;
align-items: center;
position: relative;
& > .title {
position: absolute;
margin: auto;
width: 100%;
text-align: center;
display: block;
font-size: 14px;
color: var(--g-color-20);
z-index: -1;
user-select: none;
}
& > div {
display: flex;
}
& > .btns {
background: var(--g-color-98);
}
.btn {
width: 30px;
height: 30px;
box-sizing: border-box;
display: flex;
justify-content: center;
align-items: center;
font-size: 12px;
color: var(--g-color-20);
border-radius: var(--g-border-radius);
margin: 4px;
transition: .1s ease-in-out;
&.flat {
width: 30px;
height: 30px;
margin: 0;
}
&.checked {
background: var(--g-color-96);
}
.svg-icon {
width: 12px;
height: 12px;
pointer-events: none;
}
&:not(.disabled):not(.checked):hover {
background: var(--g-color-92);
}
&.disabled {
color: var(--g-color-50);
cursor: default;
}
}
}
@include dark-theme {
.action-bar {
.btn {
&.checked {
background: var(--g-color-60);
}
&:not(.disabled):not(.checked):hover {
background: var(--g-color-76);
}
}
}
}
</style>
Loading
Oops, something went wrong.

0 comments on commit f6e5679

Please sign in to comment.