Skip to content

Commit

Permalink
Merge branch 'release/3.63.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
purocean committed Oct 27, 2023
2 parents 46096a6 + 52aa04b commit 1e489db
Show file tree
Hide file tree
Showing 56 changed files with 785 additions and 693 deletions.
33 changes: 21 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ For more information on how to use the following functions, please see [characte
- **Embedded Applets:** document supports embedded HTML Applets
- **Embed PlantUML graphics:** document supports embedded plantUML graphics
- **Embed drawio graphics:** document supports embedded drawio graphics
- **Embed ECharts graphics:** document supports embeded Echarts graphics
- **Embed Mermaid graphics:** document supports embeded Mermaid graphics
- **Embed Luckysheet tables:** document supports embeded Luckysheet tables
- **Embed ECharts graphics:** document supports embedded Echarts graphics
- **Embed Mermaid graphics:** document supports embedded Mermaid graphics
- **Embed Luckysheet tables:** document supports embedded Luckysheet tables
- **Mind map:** nested list can be displayed in the form of a mind map
- **Element attribute writing:** any attribute of an element can be customized
- **Table enhancement:** support table title with multiple lines of text, list and other features
Expand All @@ -76,15 +76,24 @@ For more information on how to use the following functions, please see [characte

## Changelogs

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

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

1. feat: sidebar document outline supports folding and expansion
2. feat: supports offline activation of premium version
3. feat: When pasting a link after selecting text, the link will be automatically inserted and the selected text will be used as the link text. Links with # are supported.
4. feat: Add `bat` language highlighting
5. fix: Fixed the problem of failure to open attachments when the warehouse uses a network path on Windows
### [v3.63.2](https://github.com/purocean/yn/releases/tag/v3.63.2) 2023-10-08

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

1. feat: Automatically convert tab-separated tables to markdown format when pasting.
2. feat: Table cell editing now supports keyboard shortcuts:
- `DBLClick`: Edit cell
- `Escape`: Exit editing
- `Enter`: Confirm editing and edit the next row
- `Shift + Enter`: Confirm editing and edit the previous row
- `Cmd/Ctrl + Shift + Enter`: Confirm editing and insert a new row below
- `Tab`: Confirm editing and edit the next column
- `Shift + Tab`: Confirm editing and edit the previous column
3. feat: Other user experience improvements.
4. fix: Fixed the issue with abnormal rendering of transparent background PlantUML diagrams.
5. chore: Dependency upgrades: `@vscode/ripgrep` and `socket.io`.
6. refactor: No longer using Vuex.
7. feat(plugin): Added support for `yank-note://` [Deep Link](https://www.electronjs.org/docs/latest/tutorial/launch-app-from-url-in-another-app).

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

Expand Down
27 changes: 18 additions & 9 deletions README_ZH-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,24 @@

## 更新日志

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

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

1. feat: 侧栏文档大纲支持折叠展开
2. feat: 支持离线激活高级版
3. feat: 选中文本后粘贴链接时,自动插入链接并以选中文本作为链接文本,支持带 # 的链接
4. feat: 增加 `bat` 语言高亮
5. fix: 修复 Windows 上仓库使用网络路径时候打开附件失败的问题
### [v3.63.2](https://github.com/purocean/yn/releases/tag/v3.63.2) 2023-10-08

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

1. feat: 粘贴 tab 分割的表格时候自动转化为 markdown 格式表格
2. feat: 表格编辑编辑单元格时支持快捷键
- `DBLClick`: 编辑单元格
- `Escape`: 退出编辑
- `Enter`: 确认编辑并编辑下一行
- `Shift + Enter`: 确认编辑并编辑上一行
- `Cmd/Ctrl + Shift + Enter`: 确认编辑并插入下一行
- `Tab`: 确认编辑并编辑下一列
- `Shift + Tab`: 确认编辑并编辑上一列
3. feat: 其他使用体验提升
4. fix: 修复渲染透明背景 PlantUML 图形时显示异常的问题
5. chore: 升级依赖:`@vscode/ripgrep` `socket.io`
6. refactor: 不再使用 vuex
7. feat(plugin): 支持 `yank-note://` [Deep Link](https://www.electronjs.org/docs/latest/tutorial/launch-app-from-url-in-another-app)

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

Expand Down
10 changes: 9 additions & 1 deletion help/FEATURES.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,15 @@ a -> b
This feature is implemented using [markdown-it-multimd-table](https://github.com/RedBug312/markdown-it-multimd-table).
Support the use of multiple lines of text and lists in tables. Support table description rendering.

You can double click / right click table cell to quickly edit table cell content.
You can double-click or right-click on a cell to quickly edit its content. Here are the related shortcuts:

- `DBLClick`: Edit cell
- `Escape`: Exit editing
- `Enter`: Confirm editing and move to the next row
- `Shift + Enter`: Confirm editing and move to the previous row
- `Cmd/Ctrl + Shift + Enter`: Confirm editing and insert a new row below
- `Tab`: Confirm editing and move to the next column
- `Shift + Tab`: Confirm editing and move to the previous column

First header | Second header
-------------|---------------
Expand Down
9 changes: 8 additions & 1 deletion help/FEATURES_ZH-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,14 @@ a -> b
此功能使用 [markdown-it-multimd-table](https://github.com/RedBug312/markdown-it-multimd-table) 实现
支持在表格中使用多行文本和列表。支持表格说明渲染

您可以双击/右键单元格快捷编辑单元格内容
您可以双击/右键单元格快捷编辑单元格内容,相关快捷键:
- `DBLClick`: 编辑单元格
- `Escape`: 退出编辑
- `Enter`: 确认编辑并编辑下一行
- `Shift + Enter`: 确认编辑并编辑上一行
- `Cmd/Ctrl + Shift + Enter`: 确认编辑并插入下一行
- `Tab`: 确认编辑并编辑下一列
- `Shift + Tab`: 确认编辑并编辑上一列

First header | Second header
-------------|---------------
Expand Down
13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yank.note",
"version": "3.62.2",
"version": "3.63.2",
"description": "Yank Note: A highly extensible Markdown editor, designed for productivity.",
"main": "dist/main/app.js",
"license": "AGPL-3.0",
Expand All @@ -24,7 +24,7 @@
},
"dependencies": {
"@electron/remote": "^2.0.10",
"@vscode/ripgrep": "^1.14.2",
"@vscode/ripgrep": "^1.15.6",
"adm-zip": "^0.5.9",
"app-license": "^0.3.0",
"async-lock": "^1.4.0",
Expand Down Expand Up @@ -55,7 +55,7 @@
"request": "^2.88.2",
"ripgrep-wrapper": "^1.1.1",
"safe-buffer": "^5.2.1",
"socket.io": "^2.4.0",
"socket.io": "^4.7.2",
"socks-proxy-agent": "^6.1.1",
"tar-stream": "^2.2.0",
"transliteration": "^2.2.0",
Expand Down Expand Up @@ -88,7 +88,7 @@
"@types/prismjs": "^1.26.0",
"@types/qrcode": "^1.5.2",
"@types/request": "^2.48.5",
"@types/socket.io-client": "^1.4.34",
"@types/socket.io-client": "^3.0.0",
"@types/sortablejs": "^1.10.6",
"@types/tar-stream": "^2.2.2",
"@types/turndown": "^5.0.0",
Expand All @@ -103,7 +103,7 @@
"@vue/eslint-config-typescript": "^9.1.0",
"autoprefixer": "^10.2.6",
"canvas-confetti": "^1.6.0",
"crypto-js": "^3.3.0",
"crypto-js": "^4.2.0",
"dom-to-image": "^2.6.0",
"electron": "22.3.25",
"electron-builder": "^23.6.0",
Expand Down Expand Up @@ -138,7 +138,7 @@
"path-browserify": "^1.0.1",
"prismjs": "^1.29.0",
"sass": "^1.35.1",
"socket.io-client": "^2.4.0",
"socket.io-client": "^4.7.2",
"sortablejs": "^1.13.0",
"ts-jest": "^27.1.2",
"ts-node": "^10.0.0",
Expand All @@ -151,7 +151,6 @@
"vue": "^3.2.23",
"vue-router": "^4.0.0-0",
"vue-tsc": "^0.29.8",
"vuex": "^4.0.0-0",
"xterm": "^4.18.0",
"xterm-addon-fit": "^0.5.0",
"xterm-theme": "^1.1.0"
Expand Down
41 changes: 38 additions & 3 deletions src/main/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,15 @@ const getOpenFilePathFromArgv = (argv: string[]) => {
return filePath ? path.resolve(process.cwd(), filePath) : null
}

const getDeepLinkFromArgv = (argv: string[]) => {
const lastArgv = argv[argv.length - 1]
if (lastArgv && lastArgv.startsWith(APP_NAME + '://')) {
return lastArgv
}

return null
}

const getUrl = (mode?: typeof urlMode) => {
mode = mode ?? urlMode

Expand Down Expand Up @@ -421,7 +430,7 @@ const serve = () => {
server.on('error', (e: Error) => {
console.error(e)

if (e.message.includes('EADDRINUSE')) {
if (e.message.includes('EADDRINUSE') || e.message.includes('EACCES')) {
// wait for electron app ready.
setTimeout(async () => {
await dialog.showMessageBox({
Expand Down Expand Up @@ -498,6 +507,12 @@ async function tryOpenFile (path: string) {
}
}

async function tryHandleDeepLink (url: string) {
if (url) {
jsonRPCClient.call.ctx.base.triggerDeepLinkOpen(url)
}
}

registerAction('show-main-window', showWindow)
registerAction('hide-main-window', hideWindow)
registerAction('toggle-fullscreen', toggleFullscreen)
Expand All @@ -516,18 +531,33 @@ registerAction('get-proxy-agent', getProxyAgent)

powerMonitor.on('shutdown', quit)

if (process.defaultApp) {
if (process.argv.length >= 2) {
app.setAsDefaultProtocolClient(APP_NAME, process.execPath, [path.resolve(process.argv[1])])
}
} else {
app.setAsDefaultProtocolClient(APP_NAME)
}

const gotTheLock = app.requestSingleInstanceLock()
if (!gotTheLock) {
app.exit()
} else {
app.on('second-instance', (e, argv) => {
console.log('second-instance', argv)
showWindow()

const url = getDeepLinkFromArgv(argv)
if (url) {
tryHandleDeepLink(url)
return
}

// only check last param of argv.
const path = getOpenFilePathFromArgv([argv[argv.length - 1]])
if (path) {
tryOpenFile(path)
}

showWindow()
})

app.on('open-file', (e, path) => {
Expand All @@ -540,6 +570,11 @@ if (!gotTheLock) {
}
})

app.on('open-url', (e, url) => {
e.preventDefault()
tryHandleDeepLink(url)
})

app.on('ready', () => {
startup()
serve()
Expand Down
6 changes: 6 additions & 0 deletions src/main/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ export async function install (id: string, url: string) {
const extract = tar.extract()

extract.on('entry', (header, stream, next) => {
if (header.name.includes('..')) {
console.log('[extension] invalid file name', header.name)
next()
return
}

const filePath = path.join(extensionPath, header.name.replace(/^package/, ''))
console.log('[extension] write', header.type, filePath)

Expand Down
3 changes: 3 additions & 0 deletions src/main/jsonrpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ type Ctx = {
doc: {
switchDocByPath: (path: string) => Promise<void>
},
base: {
triggerDeepLinkOpen: (url: string) => Promise<void>
}
}

class ElectronMainClientChannel implements JSONRPCClientChannel {
Expand Down
8 changes: 3 additions & 5 deletions src/renderer/components/ActionBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,17 @@

<script lang="ts" setup>
import { onBeforeUnmount, ref, toRef } from 'vue'
import { useStore } from 'vuex'
import { getActionHandler, registerAction, removeAction } from '@fe/core/action'
import { useContextMenu } from '@fe/support/ui/context-menu'
import type { AppState } from '@fe/support/store'
import { useI18n } from '@fe/services/i18n'
import { toggleOutline, ControlCenter } from '@fe/services/workbench'
import { findInRepository } from '@fe/services/base'
import { getKeysLabel } from '@fe/core/keybinding'
import { registerHook, removeHook } from '@fe/core/hook'
import store from '@fe/support/store'
import type { FileSort, Components } from '@fe/types'
import SvgIcon from './SvgIcon.vue'
import { registerHook, removeHook } from '@fe/core/hook'
const store = useStore<AppState>()
const navigation = ref<Components.ControlCenter.Schema['navigation']>()
const showOutline = toRef(store.state, 'showOutline')
const treeSort = toRef(store.state, 'treeSort')
Expand All @@ -63,7 +61,7 @@ function showSortMenu () {
label: t(('tree.sort.by-' + by) as any, t(('tree.sort.' + order) as any)),
checked: sort.by === by && sort.order === order,
onClick: () => {
store.commit('setTreeSort', { by, order })
store.state.treeSort = { by, order }
},
}
}
Expand Down
7 changes: 3 additions & 4 deletions src/renderer/components/DefaultEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@

<script lang="ts">
import { defineComponent, nextTick, onBeforeMount, onMounted, ref, toRefs, watch } from 'vue'
import { useStore } from 'vuex'
import { registerHook, removeHook } from '@fe/core/hook'
import { registerAction, removeAction } from '@fe/core/action'
import { isEncrypted, isSameFile, saveDoc, toUri } from '@fe/services/document'
import { getEditor, isDefault, setValue, whenEditorReady } from '@fe/services/editor'
import { FLAG_READONLY, HELP_REPO_NAME } from '@fe/support/args'
import { getSetting } from '@fe/services/setting'
import { getCurrentLanguage } from '@fe/services/i18n'
import store from '@fe/support/store'
import type { Doc } from '@fe/types'
import MonacoEditor from './MonacoEditor.vue'
Expand All @@ -22,7 +22,6 @@ export default defineComponent({
components: { MonacoEditor },
setup () {
let editorIsReady = false
const store = useStore()
let timer: number | null = null
const refEditor = ref<any>(null)
Expand All @@ -33,7 +32,7 @@ export default defineComponent({
function setCurrentValue ({ uri, value }: { uri: string; value: any}) {
if (toUri(currentFile.value) === uri && isDefault()) {
store.commit('setCurrentContent', value)
store.state.currentContent = value
}
}
Expand All @@ -45,7 +44,7 @@ export default defineComponent({
}
async function saveFile (f: Doc | null = null) {
const file: Doc = f || currentFile.value
const file = f || currentFile.value
if (!(file && file.repo && file.path && file.status)) {
return
Expand Down
9 changes: 3 additions & 6 deletions src/renderer/components/DefaultPreviewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
</template>

<script lang="tsx" setup>
import { useStore } from 'vuex'
import { computed, defineComponent, h, nextTick, onBeforeUnmount, onMounted, ref, shallowRef, watch } from 'vue'
import { IFrame as XIFrame } from '@fe/support/embed'
import { getLogger } from '@fe/utils'
Expand All @@ -39,17 +38,17 @@ import { disableSyncScrollAwhile, getHeadings, getViewDom, Heading, scrollTopTo
import { printCurrentDocument, toggleExportPanel } from '@fe/services/export'
import { useI18n } from '@fe/services/i18n'
import { getEditor } from '@fe/services/editor'
import type { AppState } from '@fe/support/store'
import { useToast } from '@fe/support/ui/toast'
import { isElectron } from '@fe/support/env'
import { FileTabs } from '@fe/services/workbench'
import { isMarkdownFile } from '@fe/services/document'
import store from '@fe/support/store'
import type { Components } from '@fe/types'
import DefaultPreviewerRender from './DefaultPreviewerRender.ce.vue'
import SvgIcon from './SvgIcon.vue'
import Outline from './Outline.vue'
import FindInPreview from './FindInPreview.vue'
import { FileTabs } from '@fe/services/workbench'
import { isMarkdownFile } from '@fe/services/document'
const { t } = useI18n()
Expand All @@ -63,8 +62,6 @@ const iframeProps = {
const initHTML = '<div id="app">Loading……</div>'
const store = useStore<AppState>()
const filePath = computed(() => store.state.currentFile?.path)
const container = shallowRef<HTMLIFrameElement | null>(null)
Expand Down

1 comment on commit 1e489db

@vercel
Copy link

@vercel vercel bot commented on 1e489db Oct 27, 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.vercel.app
yn-api-doc-git-master-purocean.vercel.app
yn-api-doc-purocean.vercel.app

Please sign in to comment.