Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
* dev:
  chore(release): v0.8.30
  feat: #642 修改配置的默认值为false(与旧版本效果保持一致)
  feat: #642 在调用setMarkdown/setValue时保持页面的滚动位置
  docs(cherry): custom render (#661)
  feat: #642 close 增加配置,是否在初始化时保持页面的滚动位置
  feat: 优化处理base64数据的时机和正则,确保base64数据能够及时被替换成占位符
  feat: 增加字数统计功能 (#659)
  fix: 修复formatFullWidthMark函数 (#655)
  refactor(client): add sidebar tags (#644)
  fix: #650 修复切换主题时原始class被改错的问题
  feat: #653 增加新的配置开关,打开后cherry完成初始化后会根据hash进行 滚动定位 在demo里默认打开
  feat: #653 增加新的配置开关,打开后cherry完成初始化后会根据hash进行 滚动定位
  fix: #650 switchModel()API切换预览模式时隐藏工具栏
  • Loading branch information
jiawei686 committed Dec 7, 2023
2 parents 61371f0 + bb35133 commit 7be2189
Show file tree
Hide file tree
Showing 68 changed files with 198,980 additions and 541 deletions.
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,31 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [0.8.30--skip.tag](https://github.com/Tencent/cherry-markdown/compare/v0.8.29...v0.8.30--skip.tag) (2023-12-07)


### Features

* [#642](https://github.com/Tencent/cherry-markdown/issues/642) close 增加配置,是否在初始化时保持页面的滚动位置 ([b58de6d](https://github.com/Tencent/cherry-markdown/commit/b58de6d83fba8ab1ff12a039f529f43e9f3e8447))
* [#642](https://github.com/Tencent/cherry-markdown/issues/642) 修改配置的默认值为false(与旧版本效果保持一致) ([c7a800d](https://github.com/Tencent/cherry-markdown/commit/c7a800d4bb762f026b616c78e7b4d454abec8a42))
* [#642](https://github.com/Tencent/cherry-markdown/issues/642) 在调用setMarkdown/setValue时保持页面的滚动位置 ([5106859](https://github.com/Tencent/cherry-markdown/commit/51068590a67d52e33ccd9fd9dcad2b52dd306e25))
* [#653](https://github.com/Tencent/cherry-markdown/issues/653) 增加新的配置开关,打开后cherry完成初始化后会根据hash进行 滚动定位 ([50bc19d](https://github.com/Tencent/cherry-markdown/commit/50bc19d6ed73e644a0f610face5eb644220dacd3))
* [#653](https://github.com/Tencent/cherry-markdown/issues/653) 增加新的配置开关,打开后cherry完成初始化后会根据hash进行 滚动定位 在demo里默认打开 ([029f3d2](https://github.com/Tencent/cherry-markdown/commit/029f3d2840ea8b1eeba19fcd7d76ec15522cceb0))
* 优化处理base64数据的时机和正则,确保base64数据能够及时被替换成占位符 ([5bbb803](https://github.com/Tencent/cherry-markdown/commit/5bbb8034c1a7bc31b88c473599301a6a1f2f4ff4))
* 增加字数统计功能 ([#659](https://github.com/Tencent/cherry-markdown/issues/659)) ([e313d0c](https://github.com/Tencent/cherry-markdown/commit/e313d0c3f6da6642db49b72fc7ddeac82616a897))


### Bug Fixes

* [#650](https://github.com/Tencent/cherry-markdown/issues/650) switchModel()API切换预览模式时隐藏工具栏 ([b573fd3](https://github.com/Tencent/cherry-markdown/commit/b573fd3b8f800044520ebbdcc3944510f08a2ee3))
* [#650](https://github.com/Tencent/cherry-markdown/issues/650) 修复切换主题时原始class被改错的问题 ([30be078](https://github.com/Tencent/cherry-markdown/commit/30be078aec720a69b160e9cb54121481d21d1c7b))
* 修复formatFullWidthMark函数 ([#655](https://github.com/Tencent/cherry-markdown/issues/655)) ([8d34763](https://github.com/Tencent/cherry-markdown/commit/8d3476318914297ad0952658377184f29dbe7ae9))


### Code Refactoring

* **client:** add sidebar tags ([#644](https://github.com/Tencent/cherry-markdown/issues/644)) ([32e8525](https://github.com/Tencent/cherry-markdown/commit/32e8525a8b7b55d9c03f7d8280f5a2209880227a))

### [0.8.29](https://github.com/Tencent/cherry-markdown/compare/v0.8.28...v0.8.29) (2023-11-20)

### [0.8.28](https://github.com/Tencent/cherry-markdown/compare/v0.8.27...v0.8.28) (2023-11-20)
Expand Down
22 changes: 12 additions & 10 deletions client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cherry-noted",
"version": "0.0.4",
"version": "0.0.5",
"main": "dist-electron/main/index.js",
"description": "cherry markdown editor in the Desktop.",
"author": "Cherry Oteam",
Expand All @@ -22,21 +22,23 @@
"build": "vue-tsc --noEmit && vite build && electron-builder"
},
"devDependencies": {
"@types/node": "^20.5.6",
"@vitejs/plugin-vue": "^4.1.0",
"@iconify/json": "^2.2.143",
"@iconify/vue": "^4.1.1",
"@types/node": "^20.9.2",
"@vitejs/plugin-vue": "^4.5.0",
"electron": "^23.1.1",
"electron-builder": "^23.6.0",
"sass": "^1.62.0",
"typescript": "^5.0.2",
"vite": "^4.1.4",
"vite-plugin-electron": "0.14.0-beta.0",
"vite-plugin-electron-renderer": "^0.14.1",
"vue-tsc": "^1.2.0"
"vite-plugin-electron": "0.15.4",
"vite-plugin-electron-renderer": "^0.14.5",
"vue-tsc": "^1.8.22"
},
"dependencies": {
"cherry-markdown": "^0.8.24",
"pinia": "^2.1.6",
"tdesign-vue-next": "^1.3.0",
"vue": "^3.3.4"
"cherry-markdown": "^0.8.27",
"pinia": "^2.1.7",
"tdesign-vue-next": "^1.6.8",
"vue": "^3.3.8"
}
}
2 changes: 1 addition & 1 deletion client/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
</template>

<script setup lang="ts">
import Home from "@/pages/home.vue"
import Home from "@/pages/home/index.vue"
</script>

3 changes: 2 additions & 1 deletion client/src/components/CherryMarkdown/cherry.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useStoreCherry } from "@/store/storeCherry";
import Cherry from "cherry-markdown";
import { CherryOptions } from "cherry-markdown/types/cherry";
import { ipcRenderer } from "electron";
import { onMounted } from "vue";

Expand Down Expand Up @@ -255,7 +256,7 @@ const initCherryMarkdown = () => {
};

onMounted(() => {
const cherryInstance = new Cherry(defaultConfig);
const cherryInstance = new Cherry(defaultConfig as Partial<CherryOptions>);
storeCherry.cherry = cherryInstance
})
}
Expand Down
60 changes: 0 additions & 60 deletions client/src/components/SidePanel/TagList/index.vue

This file was deleted.

88 changes: 0 additions & 88 deletions client/src/components/SidePanel/index.vue

This file was deleted.

9 changes: 5 additions & 4 deletions client/src/pages/home.vue → client/src/pages/home/index.vue
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
<template>
<div class="home">
<SideTagList />
<SidePanel v-show="isShowSidePanel" />
<CherryMarkdown />
</div>
</template>
<script setup lang="ts">
import CherryMarkdown from "@/components/CherryMarkdown/index.vue"
import SidePanel from "@/components/SidePanel/index.vue"
import SidePanel from "@/pages/sidePanel/index.vue"
import SideTagList from "@/pages/sideTagList/index.vue"
import { ipcRenderer } from "electron";
import { ref } from "vue";
const isShowSidePanel = ref(true)
ipcRenderer.on('show-directory-panel', () => isShowSidePanel.value = !isShowSidePanel.value)
const isShowSidePanel = ref(true);
ipcRenderer.on('show-directory-panel', () => isShowSidePanel.value = !isShowSidePanel.value);
</script>

<style scoped lang="scss">
Expand Down
13 changes: 13 additions & 0 deletions client/src/pages/sidePanel/components/Files/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<template>
<div class="files" v-show="storeSidePanel.checkedSidePanel.id === 'files'">files //todo</div>
</template>
<script setup lang="ts">
import { useStoreSidePanel } from "@/store/storeSidePanel";
const storeSidePanel = useStoreSidePanel();
</script>
<style scoped lang="scss">
.files {
width: 300px;
}
</style>
63 changes: 63 additions & 0 deletions client/src/pages/sidePanel/components/Toc/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<template>
<div class="toc" v-show="storeSidePanel.checkedSidePanel.id === 'toc'">
<div class="toc__item" v-for="item in storeCherry.cherryToc " :key="item.id"
:style="{ fontSize: 22 - item.level + 'px' }">
<span class="toc-level" :style="{ marginLeft: 4 * item.level - 1 + 'px' }">{{ `h${item.level} ` }}</span>
<div class="toc-text" v-html="item.text"></div>
</div>
</div>
</template>
<script setup lang="ts">
import { useStoreCherry } from "@/store/storeCherry";
import { useStoreSidePanel } from "@/store/storeSidePanel";
const storeCherry = useStoreCherry();
const storeSidePanel = useStoreSidePanel();
</script>

<style scoped lang="scss">
.toc {
width: 300px;
&__item {
user-select: none;
display: flex;
align-items: center;
border-bottom: 1px solid #9a9a9a;
margin: 12px;
.toc-text {
font-weight: bold;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
cursor: pointer;
position: relative;
&:hover {
color: #00a2ff96;
}
&:active {
color: #00a2ff;
}
}
.toc-level {
margin: 0 5px;
color: #182a00;
font-size: 12px;
}
}
}
:deep(.anchor) {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
}
</style>
Loading

0 comments on commit 7be2189

Please sign in to comment.