Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.2.9 #328

Merged
merged 2 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG_CN.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## v2.2.9 09/01 2024

1. 为 3.0 版本做准备。

## v2.2.8 21/12 2023

1. 更新 MS Word 证书。
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG_EN.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## v2.2.9 Jan 09 2024

1. Prepare for version 3.0.

## v2.2.8 Dec 21 2023

1. Update the certificate for MS Word add-in.
Expand Down
10 changes: 7 additions & 3 deletions app/preference/preference.ts
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ export class Preference {

// depracated scrapers
const existingScraperArray = this.store.get(
"scrapers",
"scrapers"
) as unknown as ScraperPreference[];

if (existingScraperArray && !!existingScraperArray[Symbol.iterator]) {
Expand Down Expand Up @@ -530,14 +530,14 @@ export class Preference {
}

const existingDownloaderArray = this.store.get(
"downloaders",
"downloaders"
) as unknown as DownloaderPreference[];

if (existingDownloaderArray) {
for (const defaultDownloader of defaultPreferences.downloaders) {
if (
!existingDownloaderArray.find(
(downloader) => downloader.name === defaultDownloader.name,
(downloader) => downloader.name === defaultDownloader.name
)
) {
existingDownloaderArray.push(defaultDownloader);
Expand Down Expand Up @@ -573,4 +573,8 @@ export class Preference {
set(key: string, value: unknown) {
this.store.set(key, value);
}

has(key: string) {
return this.store.has(key);
}
}
38 changes: 20 additions & 18 deletions app/renderer/ui/app-view.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import MainView from "./main-view/main-view.vue";
import PreferenceView from "./preference-view/preference-view.vue";
import PresettingView from "./presetting-view/presetting-view.vue";
import SidebarView from "./sidebar-view/sidebar-view.vue";
import VersionCheckingView from "./version-checking-view/version-checking-view.vue";
import WhatsNewView from "./whats-new-view/whats-new-view.vue";

// ================================
Expand All @@ -36,7 +37,7 @@ const logState = MainRendererStateStore.useLogState();
const paperEntities: Ref<PaperEntityResults> = ref([]);
provide(
"paperEntities",
computed(() => paperEntities.value),
computed(() => paperEntities.value)
);
const tags: Ref<CategorizerResults> = ref([]);
provide("tags", tags);
Expand All @@ -49,7 +50,7 @@ provide("feeds", feeds);
const feedEntities: Ref<FeedEntityResults> = ref([]);
provide(
"feedEntities",
computed(() => feedEntities.value),
computed(() => feedEntities.value)
);

// ================================
Expand Down Expand Up @@ -82,60 +83,60 @@ const reloadPaperEntities = async () => {
tag,
folder,
prefState.mainviewSortBy,
prefState.mainviewSortOrder,
prefState.mainviewSortOrder
);
};
watch(
() => dbState.entitiesUpdated,
(value) => reloadPaperEntities(),
(value) => reloadPaperEntities()
);

const reloadTags = async () => {
tags.value = await window.entityInteractor.loadCategorizers(
"PaperTag",
prefState.sidebarSortBy,
prefState.sidebarSortOrder,
prefState.sidebarSortOrder
);
};
watch(
() => dbState.tagsUpdated,
(value) => reloadTags(),
(value) => reloadTags()
);

const reloadFolders = async () => {
folders.value = await window.entityInteractor.loadCategorizers(
"PaperFolder",
prefState.sidebarSortBy,
prefState.sidebarSortOrder,
prefState.sidebarSortOrder
);
};
watch(
() => dbState.foldersUpdated,
(value) => reloadFolders(),
(value) => reloadFolders()
);

const reloadPaperSmartFilters = async () => {
smartfilters.value = await window.entityInteractor.loadPaperSmartFilters(
"PaperPaperSmartFilter",
prefState.sidebarSortBy === "count" ? "name" : prefState.sidebarSortBy,
prefState.sidebarSortOrder,
prefState.sidebarSortOrder
);
};
watch(
() => dbState.smartfiltersUpdated,
(value) => reloadPaperSmartFilters(),
(value) => reloadPaperSmartFilters()
);

const reloadFeeds = async () => {
const results = await window.feedInteractor.loadFeeds(
prefState.sidebarSortBy,
prefState.sidebarSortOrder,
prefState.sidebarSortOrder
);
feeds.value = results;
};
watch(
() => dbState.feedsUpdated,
(value) => reloadFeeds(),
(value) => reloadFeeds()
);

const reloadFeedEntities = async () => {
Expand All @@ -155,12 +156,12 @@ const reloadFeedEntities = async () => {
feed,
unread,
prefState.mainviewSortBy,
prefState.mainviewSortOrder,
prefState.mainviewSortOrder
);
};
watch(
() => dbState.feedEntitiesUpdated,
(value) => reloadFeedEntities(),
(value) => reloadFeedEntities()
);

// ================================
Expand All @@ -180,7 +181,7 @@ watch(
} else if (viewState.contentType === "feed") {
reloadFeedEntities();
}
},
}
);

watch(
Expand All @@ -189,7 +190,7 @@ watch(
reloadTags();
reloadFolders();
reloadPaperSmartFilters();
},
}
);

watch(
Expand All @@ -210,7 +211,7 @@ watch(
feedEntities.value = [];

window.appInteractor.initDB();
},
}
);

watch(
Expand All @@ -225,7 +226,7 @@ watch(
reloadFeedEntities();
reloadFeeds();
console.timeEnd("Reload Data");
},
}
);

window.appInteractor.registerMainSignal("window-lost-focus", (_: any) => {
Expand Down Expand Up @@ -350,6 +351,7 @@ onMounted(async () => {
<MainView />
</pane>
</splitpanes>
<VersionCheckingView />
<EditView />
<FeedEditView />
<PaperSmartFilterEditView />
Expand Down
102 changes: 102 additions & 0 deletions app/renderer/ui/version-checking-view/version-checking-view.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<script setup lang="ts">
import { onMounted, ref } from "vue";

const isShown = ref(false);

const onClick = () => {
isShown.value = false;
window.preference.set("alreadyShownVersionCheck", true);
};

const checkShouldShow = () => {
let alreadyShownExist = window.preference.has("alreadyShownVersionCheck");
let alreadyShown;
if (alreadyShownExist) {
alreadyShown = window.preference.get("alreadyShownVersionCheck");
} else {
alreadyShown = false;
}

if (alreadyShown) {
isShown.value = false;
return;
}

const scrapers = window.preference.get("scrapers");
const isCustomScraperExist = Object.values(scrapers).some(

Check failure on line 26 in app/renderer/ui/version-checking-view/version-checking-view.vue

View workflow job for this annotation

GitHub Actions / e2e_test_mac_arm (16.17.1)

No overload matches this call.
(scraper) => scraper.custom

Check failure on line 27 in app/renderer/ui/version-checking-view/version-checking-view.vue

View workflow job for this annotation

GitHub Actions / e2e_test_mac_arm (16.17.1)

Object is of type 'unknown'.
);

const downloaders = window.preference.get("downloaders");
const isCustomDownloaderExist = Object.values(downloaders).some(

Check failure on line 31 in app/renderer/ui/version-checking-view/version-checking-view.vue

View workflow job for this annotation

GitHub Actions / e2e_test_mac_arm (16.17.1)

No overload matches this call.
(downloader) => downloader.custom

Check failure on line 32 in app/renderer/ui/version-checking-view/version-checking-view.vue

View workflow job for this annotation

GitHub Actions / e2e_test_mac_arm (16.17.1)

Object is of type 'unknown'.
);

if (isCustomScraperExist || isCustomDownloaderExist) {
isShown.value = true;
} else {
isShown.value = false;
}
};

onMounted(() => {
checkShouldShow();
});
</script>

<template>
<div
id="modal-view"
class="absolute w-full h-full top-0 left-0"
@click="onClick"
v-if="isShown"
>
<div
class="fixed top-0 right-0 left-0 z-50 w-screen h-screen bg-neutral-800 bg-opacity-50 dark:bg-neutral-900 dark:bg-opacity-80 dark:text-neutral-300"
@click.stop="onClick"
>
<div class="flex flex-col justify-center items-center w-full h-full">
<div
class="m-auto flex flex-col justify-between px-8 pt-3 pb-4 border-[1px] dark:border-neutral-800 bg-neutral-100 dark:bg-neutral-800 w-[400px] rounded-lg shadow-lg select-none space-y-5"
@click.stop=""
>
<div class="text-center text-xl font-bold">Notification</div>
<div>
<p class="mb-2">
Hi, we find that you are using custom scrapers or downloaders.
</p>
<p class="mb-2">
<b
>v2.2.9 is the last version that supports custom scrapers and
downloaders</b
>.
</p>

In v3.0.0, you can implement your own scrapers and downloaders by
our exciting extension system, and share it with others by
publishing it to the extension marketplace.
</div>

<div>
The extension development document can be found on our
<a
class="text-accentlight"
href="https://paperlib.app/en/extension-doc/"
>official webpage</a
>.
</div>

<div class="flex justify-center px-4">
<div
id="delete-confirm-btn"
class="flex h-6 rounded-md bg-accentlight dark:bg-accentdark hover:shadow-sm w-20"
@click="onClick"
>
<span class="m-auto text-xs text-white"> OK </span>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
46 changes: 28 additions & 18 deletions app/renderer/ui/whats-new-view/whats-new-view-cn.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const loadHistoryReleaseNote = () => {
xhr.open(
"GET",
"https://objectstorage.uk-london-1.oraclecloud.com/n/lrarf8ozesjn/b/bucket-20220130-2329/o/distribution%2Felectron-mac%2Fchangelog_cn.html",
true,
true
);
xhr.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
Expand Down Expand Up @@ -76,16 +76,14 @@ onMounted(() => {
<WhatsNewHeader :darkMode="darkMode" />
<div class="h-[1px] bg-neutral-200 dark:bg-neutral-600 my-8"></div>

<p class="text-center text-2xl font-bold mb-8">版本 2.2.8 更新内容</p>
<p class="text-center text-2xl font-bold mb-8">版本 2.2.9 更新内容</p>

<ul class="list-disc mb-5">
<li>
更新 MS Word 插件证书。
</li>
<li>为 3.0 版本发布做准备。</li>
</ul>

<p class="text-center text-2xl font-bold mb-8">
Paperlib 3.0.0 开发进度
Paperlib 3.0.0-beta.1 发布 🎉
</p>

<p class="mb-2">
Expand All @@ -94,21 +92,33 @@ onMounted(() => {
</p>

<p class="mb-2">
在这个大版本更新中,我们将会发布一个
<b>类 vscode 的插件系统</b>
。我们相信插件系统可以赋予 Paperlib
更多可能性。同时保持软件主体干净简洁。
</p>
<p class="mb-2">
插件系统的基本架构已经设计完成并且开发完毕。现在,我正在进行一些 Demo
插件的开发来验证并完善插件系统。同时在编写插件系统 API
文档。这可能还需要一定时间。
新年快乐。 我激动的宣布,Paperlib 3.0 的第一个 beta 版本刚刚发布了。
</p>
<p class="mb-2">
如果你有任何关于使用插件系统完成功能的想法,请在 Discord
频道中告诉我们,或者在 Github 仓库中提出
issue。更多的插件使用场景将会帮助我们设计出更好的插件系统架构。感激不尽。
在过去的大半年里,Paperlib
的所有底层代码都被重构了,以支持可扩展的插件结构。
目前,整个开发工作已经结束,大部分的 Bug
也已经被修复。因此我想是时候邀请大家参与测试。当然,包括令人激动的插件开发。
</p>
<p class="mb-2">Beta 版下载地址和插件开发文档,请前往官网查看。</p>

<p class="mb-2">相比于 Paperlib 2.x,在 3.0.0-beta.1 中:</p>

<ul class="list-disc mb-5">
<li>引入了插件系统。</li>
<li>所有的元数据搜刮器,论文下载器都被移动到了对应插件中。</li>
<li>
一个新的命令面板替换原来的搜索框,配合插件,完成更多高级功能。
</li>
<li>支持在侧边栏新建空标签和空组。</li>
<li>调整字体大小。</li>
<li>
修复了一些 Bug。 欢迎任何尝鲜用户提出你发现的
Bug,以及任何插件开发者发布您的插件。
</li>
</ul>

<p class="mb-2">下载地址和插件开发文档,请前往官网查看。</p>

<div
id="whats-new-close-btn"
Expand Down
Loading
Loading