diff --git a/.github/workflows/electron_deploy.yml b/.github/workflows/electron_deploy.yml index 90ae190c..aa2d66ed 100644 --- a/.github/workflows/electron_deploy.yml +++ b/.github/workflows/electron_deploy.yml @@ -201,7 +201,7 @@ jobs: node-version: ${{ matrix.node-versions }} - name: 'Install Node Module' - run: npm install --force + run: cp ./package.win.temp.json ./package.json && npm install --force - name: 'Build and Package' run: npm run build diff --git a/CHANGELOG_CN.md b/CHANGELOG_CN.md index 1e10bc18..3173cff7 100644 --- a/CHANGELOG_CN.md +++ b/CHANGELOG_CN.md @@ -1,3 +1,12 @@ +## v2.0.4 08/10 2022 + +1. 全文搜索的高亮结果可以显示在 PDF 预览视图下。 +2. 可调整详情面板的宽度。 +3. 优化了对于预印本论文的判断规则。 +4. 修复了内置 PDF 浏览视图下可能出现的遮挡 Bug。 +5. 修复了 Markdown 渲染超出视图,以及无法渲然 HTML 图片的 Bug。 +6. 修复了 MacOS Catalina 的兼容性 Bug。 + ## v2.0.3 02/10 2022 1. 为物理学和地球科学增添优化了元数据搜寻器以及预设推荐选择。Springer Nature, Elseivier Scopus, NASA Astrophysics Data System, SPIE: Inte. Society for Optics and Photonics. diff --git a/CHANGELOG_EN.md b/CHANGELOG_EN.md index c7287a06..c165061a 100644 --- a/CHANGELOG_EN.md +++ b/CHANGELOG_EN.md @@ -1,3 +1,12 @@ +# v2.0.4 Oct 08 2022 + +1. Fulltext search mode: the highlights of the search results will be displayed in the PDF preview view. +2. Adjustable width of the detail panel. +3. Better rules for preprint papers. +4. Fixed a bug in the PDF preview view. +5. Fixed a bug in the markdown preview. +6. Fixed a compatibility issue in MacOS Catalina. + ## v2.0.3 Oct 02 2022 1. Added some new metadata scrapers for Physics and Earth Science. Also provide a recommended presetting. Springer Nature, Elseivier Scopus, NASA Astrophysics Data System, SPIE: Inte. Society for Optics and Photonics diff --git a/app/interactors/render-interactor.ts b/app/interactors/render-interactor.ts index e718b05f..28e1002d 100644 --- a/app/interactors/render-interactor.ts +++ b/app/interactors/render-interactor.ts @@ -31,7 +31,7 @@ export class RenderInteractor { this.renderingPDF = null; this.createPDFWorker(); - this.markdownIt = new MarkdownIt().use(tm, { + this.markdownIt = new MarkdownIt({ html: true }).use(tm, { engine: require("katex"), delimiters: "dollars", katexOptions: { macros: { "\\RR": "\\mathbb{R}" } }, @@ -118,27 +118,33 @@ export class RenderInteractor { }; } - async renderMarkdown(content: string) { + async renderMarkdown(content: string, renderFull = false) { try { - return this.markdownIt.render(content); + let renderContent; + let overflow; + if (!renderFull) { + const lines = content.split("\n"); + const renderLines = lines.slice(0, 10) + overflow = lines.length > 10; + renderContent = renderLines.join("\n"); + } else { + overflow = false; + renderContent = content; + } + return { renderedStr: this.markdownIt.render(renderContent), overflow: overflow }; } catch (e) { console.error(e); - return ""; + return { renderedStr: "", overflow: false }; } } - async renderMarkdownFile(url: string) { - // Read content from file - try { - const content = await fsPromise.readFile( - url.replace("file://", ""), - "utf8" - ); - return this.markdownIt.render(content); - } catch (e) { - console.error(e); - return ""; - } + async renderMarkdownFile(url: string, renderFull = false) { + const content = await fsPromise.readFile( + url.replace("file://", ""), + "utf8" + ); + + return await this.renderMarkdown(content, renderFull); } async renderMath(content: string) { diff --git a/app/locales/locales/en.GB.json b/app/locales/locales/en.GB.json index 67155668..2f096e7c 100644 --- a/app/locales/locales/en.GB.json +++ b/app/locales/locales/en.GB.json @@ -16,6 +16,7 @@ "title": "Title", "authors": "Authors", "publicationyear": "Publication Year", + "pubyear": "Year", "publicationtitle": "Publication", "publicationtype": "Publication Type", "addtime": "Add Time", diff --git a/app/main/win_main/index.ts b/app/main/win_main/index.ts index 67370ac4..5f597553 100644 --- a/app/main/win_main/index.ts +++ b/app/main/win_main/index.ts @@ -101,6 +101,7 @@ function setWindowsSpecificStyles(win: BrowserWindow | null) { } ::-webkit-scrollbar { width: 4px; + height: 4px; } ::-webkit-scrollbar-corner { diff --git a/app/preference/preference.ts b/app/preference/preference.ts index 522434ba..39bdb2ab 100644 --- a/app/preference/preference.ts +++ b/app/preference/preference.ts @@ -92,6 +92,7 @@ export interface PreferenceStore { shortcutCopyKey: string; sidebarWidth: number; + detailPanelWidth: number; mainviewSortBy: string; mainviewSortOrder: string; mainviewType: string; @@ -169,6 +170,7 @@ export const defaultPreferences: PreferenceStore = { shortcutCopyKey: "CommandOrControl+Shift+K", sidebarWidth: 20, + detailPanelWidth: 75, mainviewSortBy: "addTime", mainviewSortOrder: "desc", mainviewType: "list", diff --git a/app/renderer/css/index.css b/app/renderer/css/index.css index 8a9354cc..9fa60966 100644 --- a/app/renderer/css/index.css +++ b/app/renderer/css/index.css @@ -134,33 +134,24 @@ ol { text-decoration: underline; } - - - - -/* Track */ -::-webkit-scrollbar-track { - background: var(--q-bg-secondary); - border-radius: 2px; +#detail-markdown-preview img { + margin-top: 15px; + margin-bottom: 15px; } -/* Handle */ -::-webkit-scrollbar-thumb { - background: #888; - border-radius: 2px; -} -/* Handle on hover */ -::-webkit-scrollbar-thumb:hover { - background: #555; +#main-view .splitpanes--vertical>.splitpanes__splitter { + min-width: 4px !important; + border-right: 1px solid rgb(229 229 229); + background-color: rgba(0, 0, 0, 0) !important; } -::-webkit-scrollbar { - width: 4px; +@media (prefers-color-scheme: dark) { + #main-view .splitpanes--vertical>.splitpanes__splitter { + border-right: 1px solid rgb(64, 64, 64); + } } -::-webkit-scrollbar-corner { - background: transparent; - width: 0 !important; - height: 0 !important; +.splitpanes .splitpanes__pane { + transition: none !important; } \ No newline at end of file diff --git a/app/renderer/ui/app-view.vue b/app/renderer/ui/app-view.vue index 112a0ec5..40fe742b 100644 --- a/app/renderer/ui/app-view.vue +++ b/app/renderer/ui/app-view.vue @@ -296,7 +296,7 @@ onMounted(async () => { --> - + diff --git a/app/renderer/ui/main-view/data-view/paper-data-view.vue b/app/renderer/ui/main-view/data-view/paper-data-view.vue index bc025353..04e0390b 100644 --- a/app/renderer/ui/main-view/data-view/paper-data-view.vue +++ b/app/renderer/ui/main-view/data-view/paper-data-view.vue @@ -15,6 +15,7 @@ import TableTitle from "./components/table-title.vue"; // ================================ // State // ================================ +const viewState = MainRendererStateStore.useViewState(); const selectionState = MainRendererStateStore.useSelectionState(); const prefState = MainRendererStateStore.usePreferenceState(); @@ -93,7 +94,12 @@ const accessMainFile = async (index: number) => { const paperEntity = paperEntities?.value[index]; if (paperEntity) { const url = await window.appInteractor.access(paperEntity!.mainURL, false); - showingUrl.value = `./viewer/viewer.html?file=${url}`; + + if (viewState.searchMode === "fulltext" && viewState.searchText !== "") { + showingUrl.value = `./viewer/viewer.html?file=${url}&search=${viewState.searchText}`; + } else { + showingUrl.value = `./viewer/viewer.html?file=${url}`; + } } else { showingUrl.value = ""; } @@ -135,7 +141,7 @@ onMounted(() => {