Skip to content

Commit

Permalink
Merge branch 'release/3.36.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
purocean committed Sep 13, 2022
2 parents a02599e + ecd4147 commit dd70d32
Show file tree
Hide file tree
Showing 37 changed files with 685 additions and 158 deletions.
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,18 @@ For more information on how to use the following functions, please see [characte

## Changelogs

### [v3.35.0](https://github.com/purocean/yn/releases/tag/v3.35.0) 2022-09-06

1. feat: add more information to the document row and column information display
2. feat: add double-clicking to change the size of the ruler to restore the default size
3. feat: the main part of the name is selected by default in the file name of the file creation dialog
4. fix: fix Reveal.js cannot display mindmap
5. feat(plugin): status bar menu title supports custom Vue components
6. feat(plugin): add `DOC_BEFORE_SAVE` hook
7. feat(plugin): add the number of selected rows and the number of selections of return value of `ctx.editor.getSelectionInfo`
8. upd(plugin): remove `ctx.store.state.selectionInfo`
### [v3.36.0](https://github.com/purocean/yn/releases/tag/v3.36.0) 2022-09-13

1. feat: optimize editor tab display, add quick search tab function
2. feat: add filtering function to the directory outline
3. upd: adjust the UI of dialogs, directories, context menus, control centers, etc.
4. upd: an error is reported when the repository path does not exist
5. fix: fix the issue that the document outline on Windows cannot display the underline at a certain zoom level of the window
6. fix: fix the problem that the brain map cannot be indented with two spaces
7. feat(plugin): add `ctx.components.QuickFilter` component
8. feat(plugin): add `ctx.command.Tab` constant
9. feat(plugin): add `ctx.ui.useQuickFilter` method
10. feat(plugin): add `file-tabs.search-tabs` action

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

Expand Down
22 changes: 12 additions & 10 deletions README_ZH-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,18 @@

## 更新日志

### [v3.35.0](https://github.com/purocean/yn/releases/tag/v3.35.0) 2022-09-06

1. feat: 文档行列信息展示增加更多信息
2. feat: 增加双击更改尺寸表尺恢复默认尺寸功能
3. feat: 创建文件对话框文件名默认选中名字主体部分
4. fix: 修复 Reveal.js 不能显示脑图问题
5. feat(plugin): 状态栏菜单标题支持自定义 Vue 组件
6. feat(plugin): 增加 `DOC_BEFORE_SAVE` 钩子
7. feat(plugin): `ctx.editor.getSelectionInfo` 返回值增加选中行数、选区数量信息
8. upd(plugin): 移除 `ctx.store.state.selectionInfo`
### [v3.36.0](https://github.com/purocean/yn/releases/tag/v3.36.0) 2022-09-13

1. feat: 优化编辑器选项卡展示,增加快速搜索选项卡功能
2. feat: 目录大纲增加过滤功能
3. upd: 调整 对话框,目录,上下文菜单、控制中心等元素的 UI
4. upd: 仓库路径不存在时候报错
5. fix: 修复 Windows 上文档大纲在窗口某个缩放级别时候不能展示下划线问题
6. fix: 修复脑图不能使用两个空格缩进问题
7. feat(plugin): 增加 `ctx.components.QuickFilter` 组件
8. feat(plugin): 增加 `ctx.command.Tab` 常量
9. feat(plugin): 增加 `ctx.ui.useQuickFilter` 方法
10. feat(plugin): 增加 `file-tabs.search-tabs` Action

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

Expand Down
2 changes: 2 additions & 0 deletions help/SHORTCUTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ 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
Search Editor Tabs | Shift + Alt/Option + P
Close Editor Current Tab | TABS-CLOSE-CURRENT
Switch Editor Current Tab | Ctrl + 0-9
Toggle Sidebar | Alt/Option + E
Expand Down Expand Up @@ -99,6 +100,7 @@ Switch Repository | Alt/Option + 0-9
编辑表格单元格(弹出框) | Ctrl/Cmd + 单击单元格
复制文档标题链接 | Ctrl/Cmd + 单击标题
切换编辑器 Tab | Ctrl/Cmd + Alt/Option + Left/Right
搜索编辑器 Tab | Shift + Alt/Option + P
关闭编辑器当前标签 Tab | TABS-CLOSE-CURRENT
切换编辑器当前标签 | Ctrl + 0-9
切换侧栏 | Alt/Option + E
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yank.note",
"version": "3.35.0",
"version": "3.36.0",
"description": "Yank Note: A hackable markdown note application for programmers",
"main": "dist/main/app.js",
"license": "AGPL-3.0",
Expand Down
9 changes: 8 additions & 1 deletion src/main/server/repository.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import * as path from 'path'
import * as fs from 'fs-extra'
import config from '../config'
import { isWsl, toWslPath } from '../wsl'

Expand All @@ -22,7 +23,13 @@ const getPath = (name: string) => {
p = /^[a-zA-Z]:/.test(p) ? toWslPath(p) : p
}

return path.isAbsolute(p) ? p : path.resolve(p)
p = path.isAbsolute(p) ? p : path.resolve(p)

if (!fs.pathExistsSync(p)) {
return null
}

return p
}

export default {
Expand Down
20 changes: 2 additions & 18 deletions src/renderer/components/ActionBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ onBeforeUnmount(() => {
</script>

<style lang="scss" scoped>
@import '@fe/styles/mixins.scss';
.action-bar {
height: 30px;
flex: none;
Expand Down Expand Up @@ -105,7 +103,7 @@ onBeforeUnmount(() => {
}
&.checked {
background: var(--g-color-96);
background: var(--g-color-active-c);
}
.svg-icon {
Expand All @@ -115,7 +113,7 @@ onBeforeUnmount(() => {
}
&:not(.disabled):not(.checked):hover {
background: var(--g-color-92);
background: var(--g-color-active-b);
}
&.disabled {
Expand All @@ -124,18 +122,4 @@ onBeforeUnmount(() => {
}
}
}
@include dark-theme {
.action-bar {
.btn {
&.checked {
background: var(--g-color-60);
}
&:not(.disabled):not(.checked):hover {
background: var(--g-color-76);
}
}
}
}
</style>
12 changes: 6 additions & 6 deletions src/renderer/components/ContextMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -117,22 +117,23 @@ export default defineComponent({
top: -99999px;
visibility: hidden;
overflow-y: auto;
background: var(--g-color-82);
background: rgba(var(--g-color-82-rgb), 0.5);
backdrop-filter: var(--g-backdrop-filter);
border: 1px var(--g-color-84) solid;
border-left: 0;
border-top: 0;
z-index: 2147483647;
color: var(--g-foreground-color);
min-width: 9em;
cursor: default;
box-shadow: rgba(0, 0, 0 , 0.3) 2px 2px 10px;
box-shadow: rgba(0, 0, 0, 0.3) 2px 2px 10px;
border-radius: var(--g-border-radius);
user-select: none;
}
.menu > li.separator {
border-top: 1px var(--g-color-80) solid;
border-bottom: 1px var(--g-color-70) solid;
border-top: 1px rgba(var(--g-color-90-rgb), 0.5) solid;
border-bottom: 1px rgba(var(--g-color-70-rgb), 0.5) solid;
margin: 3px 0;
&:first-child,
Expand All @@ -150,7 +151,6 @@ export default defineComponent({
}
.menu > li.normal:hover {
background: var(--g-color-70);
background: var(--g-color-active-b);
}
</style>
27 changes: 5 additions & 22 deletions src/renderer/components/ControlCenter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,18 @@ watch(() => store.state.showControlCenter, (val) => {
</script>
<style lang="scss">
@import '@fe/styles/mixins.scss';
.control-center {
position: fixed;
right: 25px;
bottom: 40px;
z-index: 1000;
outline: none;
background: var(--g-color-85);
background: rgba(var(--g-color-85-rgb), 0.8);
backdrop-filter: var(--g-backdrop-filter);
color: var(--g-color-10);
overflow: hidden;
border-radius: var(--g-border-radius);
box-shadow: rgba(0, 0, 0 , 0.3) 2px 2px 10px;
box-shadow: rgba(0, 0, 0, 0.3) 2px 2px 10px;
.row {
display: flex;
Expand Down Expand Up @@ -106,7 +105,7 @@ watch(() => store.state.showControlCenter, (val) => {
}
&.checked {
background: var(--g-color-96);
background: var(--g-color-active-b);
}
.svg-icon {
Expand All @@ -115,7 +114,7 @@ watch(() => store.state.showControlCenter, (val) => {
}
&:not(.disabled):not(.checked):hover {
background: var(--g-color-90);
background: var(--g-color-active-a);
}
&.disabled {
Expand All @@ -125,20 +124,4 @@ watch(() => store.state.showControlCenter, (val) => {
}
}
}
@include dark-theme {
.control-center {
.row {
.btn {
&.checked {
background: var(--g-color-70);
}
&:not(.disabled):not(.checked):hover {
background: var(--g-color-80);
}
}
}
}
}
</style>
5 changes: 3 additions & 2 deletions src/renderer/components/DocHistory.vue
Original file line number Diff line number Diff line change
Expand Up @@ -352,11 +352,12 @@ onUnmounted(() => {
<style lang="scss" scoped>
.history-wrapper {
width: 90vw;
background: var(--g-color-95);
background: var(--g-color-backdrop);
backdrop-filter: var(--g-backdrop-filter);
margin: auto;
padding: 10px;
color: var(--g-color-5);
box-shadow: rgba(0, 0, 0 , 0.3) 2px 2px 10px;
box-shadow: rgba(0, 0, 0, 0.3) 2px 2px 10px;
border-radius: var(--g-border-radius);
position: relative;
Expand Down
5 changes: 3 additions & 2 deletions src/renderer/components/ExportPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -287,11 +287,12 @@ export default defineComponent({
<style lang="scss" scoped>
.wrapper {
width: 400px;
background: var(--g-color-95);
background: var(--g-color-backdrop);
backdrop-filter: var(--g-backdrop-filter);
margin: auto;
padding: 10px;
color: var(--g-color-5);
box-shadow: rgba(0, 0, 0 , 0.3) 2px 2px 10px;
box-shadow: rgba(0, 0, 0, 0.3) 2px 2px 10px;
border-radius: var(--g-border-radius);
h3 {
Expand Down
16 changes: 7 additions & 9 deletions src/renderer/components/ExtensionManager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -582,11 +582,12 @@ onUnmounted(() => {
<style lang="scss" scoped>
.wrapper {
width: 90vw;
background: var(--g-color-95);
background: var(--g-color-backdrop);
backdrop-filter: var(--g-backdrop-filter);
margin: auto;
padding: 10px;
color: var(--g-color-5);
box-shadow: rgba(0, 0, 0 , 0.3) 2px 2px 10px;
box-shadow: rgba(0, 0, 0, 0.3) 2px 2px 10px;
border-radius: var(--g-border-radius);
position: relative;
Expand Down Expand Up @@ -616,16 +617,13 @@ onUnmounted(() => {
height: 100%;
width: 100%;
box-sizing: border-box;
// font-family: monospace;
font-size: 16px;
background-color: var(--g-color-92);
// padding: 6px;
background-color: rgba(var(--g-color-0-rgb), 0.06);
.item {
cursor: pointer;
position: relative;
// background-color: var(--g-color-92);
border-bottom: 1px var(--g-color-80) solid;
border-bottom: 1px var(--g-color-70) solid;
color: var(--g-color-20);
display: flex;
height: 77px;
Expand Down Expand Up @@ -687,12 +685,12 @@ onUnmounted(() => {
}
&:hover {
background-color: var(--g-color-86);
background-color: var(--g-color-active-a);
border-radius: var(--g-border-radius);
}
&.selected {
background-color: var(--g-color-86);
background-color: var(--g-color-active-a);
border-radius: var(--g-border-radius);
color: var(--g-color-0);
}
Expand Down
28 changes: 25 additions & 3 deletions src/renderer/components/FileTabs.vue
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
<template>
<Tabs :list="fileTabs" :value="current" @remove="removeTabs" @switch="switchTab" @change-list="setTabs"></Tabs>
<Tabs
ref="refTabs"
:list="fileTabs"
:value="current"
:filter-btn-title="filterBtnTitle"
@remove="removeTabs"
@switch="switchTab"
@change-list="setTabs"
/>
</template>

<script lang="ts">
import { useStore } from 'vuex'
import { computed, defineComponent, onBeforeMount, onBeforeUnmount, ref, toRefs, watch } from 'vue'
import { Alt, CtrlCmd } from '@fe/core/command'
import { Alt, CtrlCmd, getKeysLabel, Shift } from '@fe/core/command'
import type { Components, Doc } from '@fe/types'
import { registerHook, removeHook } from '@fe/core/hook'
import { registerAction, removeAction } from '@fe/core/action'
Expand All @@ -21,14 +29,17 @@ export default defineComponent({
name: 'file-tabs',
components: { Tabs },
setup () {
const { t } = useI18n()
const { t, $t } = useI18n()
const store = useStore()
const { currentFile, tabs } = toRefs<AppState>(store.state)
const isSaved = computed(() => store.getters.isSaved)
const list = ref<Components.FileTabs.Item[]>([])
const current = ref(blankUri)
const refTabs = ref<InstanceType<typeof Tabs> | null>(null)
const showFilterBtnShortcuts = [Shift, Alt, 'p']
const filterBtnTitle = computed(() => $t.value('tabs.search-tabs') + ' ' + getKeysLabel(showFilterBtnShortcuts))
function setTabs (list: Components.FileTabs.Item[]) {
store.commit('setTabs', list)
Expand Down Expand Up @@ -153,6 +164,14 @@ export default defineComponent({
handler: closeCurrent,
keys: isElectron ? [CtrlCmd, 'w'] : [CtrlCmd, Alt, 'w']
})
registerAction({
name: 'file-tabs.search-tabs',
handler () {
refTabs.value?.showQuickFilter()
},
keys: showFilterBtnShortcuts
})
})
onBeforeUnmount(() => {
Expand All @@ -163,6 +182,7 @@ export default defineComponent({
removeAction('file-tabs.switch-left')
removeAction('file-tabs.switch-right')
removeAction('file-tabs.close-current')
removeAction('file-tabs.search-tabs')
})
watch(currentFile, file => {
Expand Down Expand Up @@ -228,6 +248,8 @@ export default defineComponent({
removeTabs,
switchTab,
setTabs,
refTabs,
filterBtnTitle,
}
},
})
Expand Down
Loading

1 comment on commit dd70d32

@vercel
Copy link

@vercel vercel bot commented on dd70d32 Sep 13, 2022

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-purocean.vercel.app
yn-api-doc-git-master-purocean.vercel.app

Please sign in to comment.