Skip to content

Commit

Permalink
Merge branch 'release/3.58.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
purocean committed Aug 9, 2023
2 parents 701b8d7 + 84ac24f commit b6bc725
Show file tree
Hide file tree
Showing 81 changed files with 1,945 additions and 635 deletions.
28 changes: 17 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,23 @@ For more information on how to use the following functions, please see [characte

## Changelogs

### [v3.57.0](https://github.com/purocean/yn/releases/tag/v3.57.0) 2023-07-31

[Windows](https://github.com/purocean/yn/releases/download/v3.57.0/Yank-Note-win-x64-3.57.0.exe) | [macOS arm64](https://github.com/purocean/yn/releases/download/v3.57.0/Yank-Note-mac-arm64-3.57.0.dmg) | [macOS x64](https://github.com/purocean/yn/releases/download/v3.57.0/Yank-Note-mac-x64-3.57.0.dmg) | [Linux AppImage](https://github.com/purocean/yn/releases/download/v3.57.0/Yank-Note-linux-x86_64-3.57.0.AppImage) | [Linux deb](https://github.com/purocean/yn/releases/download/v3.57.0/Yank-Note-linux-amd64-3.57.0.deb)

1. feat: introducing the $seq method in the macro to generate sequential numbers like Figure-1, Figure-2.
2. feat: added configuration to hide the main window upon startup.
3. feat: implemented a configuration option to automatically add to-dos to the completion time.
4. feat: implemented size restriction for generated historical version files.
5. feat: enhanced scrolling behavior for the details tag when clicked.
6. fix: resolved the issue of extra blank lines at the end of copied code blocks.

### [v3.58.1](https://github.com/purocean/yn/releases/tag/v3.58.1) 2023-08-09

[Windows](https://github.com/purocean/yn/releases/download/v3.58.1/Yank-Note-win-x64-3.58.1.exe) | [macOS arm64](https://github.com/purocean/yn/releases/download/v3.58.1/Yank-Note-mac-arm64-3.58.1.dmg) | [macOS x64](https://github.com/purocean/yn/releases/download/v3.58.1/Yank-Note-mac-x64-3.58.1.dmg) | [Linux AppImage](https://github.com/purocean/yn/releases/download/v3.58.1/Yank-Note-linux-x86_64-3.58.1.AppImage) | [Linux deb](https://github.com/purocean/yn/releases/download/v3.58.1/Yank-Note-linux-amd64-3.58.1.deb)

1. feat: add custom shortcut key function
2. feat: adjust the shortcut key to open the main window
3. feat: the control center adds the function of adjusting the basic font size of the preview text
4. feat: the editor automatically completes code snippets and adds language selection
5. fix: when fixing multiple dialog boxes, pressing ESC will close the dialog box
6. fix: upgrade monaco-editor to 0.41.0, fix the missing fragment completion problem
7. feat(plugin): the control center supports adding custom Vue components and custom element order
8. feat(plugin): add `ctx.action.getRawActions` method
9. feat(plugin): add `ctx.action.tapAction` `ctx.action.removeActionTapper` methods
10. feat(plugin): add `COMMAND_KEYBINDING_CHANGED` hook
11. feat(plugin): add `ctx.ioc.getRaw` method
12. feat(plugin): `ctx.action.registerAction` adds `description` and `forUser` fields
13. refactor(plugin): remove `ctx.command` module, change to `ctx.keybinding` module
[More release notes](https://github.com/purocean/yn/releases)

## Supports
Expand Down
27 changes: 17 additions & 10 deletions README_ZH-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,23 @@

## 更新日志

### [v3.57.0](https://github.com/purocean/yn/releases/tag/v3.57.0) 2023-07-31

[Windows](https://github.com/purocean/yn/releases/download/v3.57.0/Yank-Note-win-x64-3.57.0.exe) | [macOS arm64](https://github.com/purocean/yn/releases/download/v3.57.0/Yank-Note-mac-arm64-3.57.0.dmg) | [macOS x64](https://github.com/purocean/yn/releases/download/v3.57.0/Yank-Note-mac-x64-3.57.0.dmg) | [Linux AppImage](https://github.com/purocean/yn/releases/download/v3.57.0/Yank-Note-linux-x86_64-3.57.0.AppImage) | [Linux deb](https://github.com/purocean/yn/releases/download/v3.57.0/Yank-Note-linux-amd64-3.57.0.deb)

1. feat: 宏增加 `$seq` 方法,用于生成如 `图-1``图-2` 这样的序号
2. feat: 增加启动隐藏主窗口的配置
3. feat: 增加勾选待办是否自动添加完成时间的配置
4. feat: 限制生成历史版本文件的大小
5. feat: 优化点击 `details` 标签时滚动行为
6. fix: 修复拷贝代码块内容末尾有多余空行的问题
### [v3.58.1](https://github.com/purocean/yn/releases/tag/v3.58.1) 2023-08-09

[Windows](https://github.com/purocean/yn/releases/download/v3.58.1/Yank-Note-win-x64-3.58.1.exe) | [macOS arm64](https://github.com/purocean/yn/releases/download/v3.58.1/Yank-Note-mac-arm64-3.58.1.dmg) | [macOS x64](https://github.com/purocean/yn/releases/download/v3.58.1/Yank-Note-mac-x64-3.58.1.dmg) | [Linux AppImage](https://github.com/purocean/yn/releases/download/v3.58.1/Yank-Note-linux-x86_64-3.58.1.AppImage) | [Linux deb](https://github.com/purocean/yn/releases/download/v3.58.1/Yank-Note-linux-amd64-3.58.1.deb)

1. feat: 增加自定义快捷键功能
2. feat: 调整打开主窗口的快捷键
3. feat: 控制中心增加调整预览文字基础字号功能
4. feat: 编辑器自动补全代码片段增加语言选择
5. fix: 修复多个对话框的时候,按下 ESC 会关闭对话框的问题
6. fix: 升级 monaco-editor 到 0.41.0,修复片段补全丢失问题
7. feat(plugin): 控制中心支持添加自定义 Vue 组件、自定元素顺序
8. feat(plugin): 增加 `ctx.action.getRawActions` 方法
9. feat(plugin): 增加 `ctx.action.tapAction` `ctx.action.removeActionTapper` 方法
10. feat(plugin): 增加 `COMMAND_KEYBINDING_CHANGED` 钩子
11. feat(plugin): 增加 `ctx.ioc.getRaw` 方法
12. feat(plugin): `ctx.action.registerAction` 增加 `description``forUser` 字段
13. refactor(plugin): 移除 `ctx.command` 模块,变更为 `ctx.keybinding` 模块

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

Expand Down
4 changes: 0 additions & 4 deletions help/PLUGIN.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ Yank Note has some concepts that are the basis for supporting the entire plug-in

1. Hook
1. Action
1. Command

### Hook

Expand Down Expand Up @@ -82,9 +81,6 @@ Yank Note has an Action Center [`ctx.action`](https://yn-api-doc.vercel.app/modu

For internal action, please refer to [Api Document](https://yn-api-doc.vercel.app/modules/renderer_types.html#BuildInActions)

### Command
Yank Note has a Command Center [`ctx.command`](https://yn-api-doc.vercel.app/modules/renderer_core_command.html), which is mainly responsible for the management and operation of shortcut keys.

## Plug-In Capabilities

As you can see from the above, the functions of the plug-in are all implemented through the modules of `ctx`.
Expand Down
7 changes: 1 addition & 6 deletions help/PLUGIN_ZH-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ Yank Note 有一些概念,是支撑整个插件体系的基础:

1. Hook 钩子
1. Action 动作
1. Command 命令

### Hook 钩子

Expand All @@ -60,7 +59,7 @@ Yank Note 在执行一些操作的时候,会触发一些钩子调用。

调用 `triggerHook` 时候附加选项 `{ breakable: true }`,表明这个钩子调用是可中断的。

下面的内部钩子调用是可中断的
如下面的内部钩子调用是可中断的

- `ACTION_AFTER_RUN`
- `ACTION_BEFORE_RUN`
Expand All @@ -80,10 +79,6 @@ Yank Note 有一个 Action 中心 [`ctx.action`](https://yn-api-doc.vercel.app/m

内部 Action 可以参考 [Api 文档](https://yn-api-doc.vercel.app/modules/renderer_types.html#BuildInActions)

### Command 命令

Yank Note 有一个 Command 中心 [`ctx.command`](https://yn-api-doc.vercel.app/modules/renderer_core_command.html),主要负责快捷键相关的管理和运行。

## 插件能力

从上面可以看到,插件的功能都是通过 `ctx` 下面挂载的模块来实现。
Expand Down
122 changes: 0 additions & 122 deletions help/SHORTCUTS.md

This file was deleted.

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.57.0",
"version": "3.58.1",
"description": "Yank Note: A highly extensible Markdown editor, designed for productivity.",
"main": "dist/main/app.js",
"license": "AGPL-3.0",
Expand Down Expand Up @@ -129,7 +129,7 @@
"markdown-it-multimd-table": "^4.1.2",
"markdown-it-sub": "^1.0.0",
"markdown-it-sup": "^1.0.0",
"monaco-editor": "^0.40.0",
"monaco-editor": "^0.41.0",
"normalize.css": "^8.0.1",
"parse-author": "^2.0.0",
"path-browserify": "^1.0.1",
Expand Down
9 changes: 5 additions & 4 deletions src/main/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const isLinux = os.platform() === 'linux'

let urlMode: 'scheme' | 'dev' | 'prod' = 'scheme'
let skipBeforeUnloadCheck = false
let mainWindowIsReady = false

const trayEnabled = !(yargs.argv['disable-tray'])
const backendPort = Number(yargs.argv.port) || config.get('server.port', 3044)
Expand Down Expand Up @@ -234,11 +235,12 @@ const createWindow = () => {
win && win.loadURL(getUrl())
restoreWindowBounds()
win.on('ready-to-show', () => {
if (config.get('hide-main-window-on-startup', false)) {
if (!mainWindowIsReady && config.get('hide-main-window-on-startup', false)) {
hideWindow()
} else {
win!.show()
}
mainWindowIsReady = true
skipBeforeUnloadCheck = false
})

Expand Down Expand Up @@ -501,14 +503,13 @@ if (!gotTheLock) {

registerShortcut({
'show-main-window': showWindow,
'hide-main-window': hideWindow,
'open-in-browser': openInBrowser
})
})

app.on('activate', () => {
if (!win) {
showWindow(false)
}
showWindow(false)
})

app.on('web-contents-created', (_, webContents) => {
Expand Down
10 changes: 5 additions & 5 deletions src/main/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ const writeJson = (data: any) => {
// save license to store
if (data.license) {
store.set('license', data.license)
delete data.license
} else {
store.delete('license')
}

delete data.license
fs.ensureFileSync(configFile)
fs.writeJsonSync(configFile, data, { spaces: 4 })
fs.writeJsonSync(configFile, data, { spaces: 2 })
}

const readJson = () => {
Expand All @@ -25,9 +27,7 @@ const readJson = () => {

// get license from store
const license = store.get('license', '')
if (license) {
result.license = license
}
result.license = license || result.license || ''

return result
} catch (error) {
Expand Down
6 changes: 6 additions & 0 deletions src/main/server/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import * as os from 'os'
import ip from 'ip'
import * as fs from 'fs-extra'
import uniq from 'lodash/uniq'
import isEqual from 'lodash/isEqual'
import * as path from 'path'
import Koa from 'koa'
import bodyParser from 'koa-body'
Expand Down Expand Up @@ -425,6 +427,9 @@ const setting = async (ctx: any, next: any) => {
const data = { ...oldConfig, ...ctx.request.body }
config.setAll(data)

const changedKeys = uniq([...Object.keys(oldConfig), ...Object.keys(data)])
.filter((key) => !isEqual(data[key], oldConfig[key]))

if (oldConfig.language !== data.language) {
getAction('i18n.change-language')(data.language)
}
Expand All @@ -435,6 +440,7 @@ const setting = async (ctx: any, next: any) => {

getAction('proxy.reload')(data)
getAction('envs.reload')(data)
getAction('shortcuts.reload')(changedKeys)

ctx.body = result('ok', 'success')
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/shell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const getShell = () => {
// use full path
// TODO better way.
if (os.platform() === 'win32') {
if (shell.toLocaleLowerCase() === 'cmd.exe' || shell.toLocaleLowerCase() === 'wsl.exe') {
if (shell.toLowerCase() === 'cmd.exe' || shell.toLowerCase() === 'wsl.exe') {
return `C:\\Windows\\System32\\${shell}`
}
}
Expand Down
Loading

1 comment on commit b6bc725

@vercel
Copy link

@vercel vercel bot commented on b6bc725 Aug 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

yn-api-doc – ./

yn-api-doc-git-master-purocean.vercel.app
yn-api-doc-purocean.vercel.app
yn-api-doc.vercel.app

Please sign in to comment.