From 6ba888f476b772f3094e7c7f8490961f2a81028d Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 30 Jun 2022 23:45:11 +0900 Subject: [PATCH] feat(client): add rss-marquee widget --- CHANGELOG.md | 1 + locales/ja-JP.yml | 1 + packages/client/package.json | 1 + packages/client/src/widgets/index.ts | 4 +- packages/client/src/widgets/rss-marquee.vue | 115 ++++++++++++++++++++ packages/client/src/widgets/rss.vue | 12 +- packages/client/yarn.lock | 15 ++- 7 files changed, 141 insertions(+), 8 deletions(-) create mode 100644 packages/client/src/widgets/rss-marquee.vue diff --git a/CHANGELOG.md b/CHANGELOG.md index 063ebf525..405c92bb3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ You should also include the user name that made the change. - Client: Improve control panel @syuilo - Client: Show warning in control panel when there is an unresolved abuse report @syuilo - Client: Add instance-cloud widget @syuilo +- Client: Add rss-marquee widget @syuilo - Make possible to delete an account by admin @syuilo - Improve player detection in URL preview @mei23 - Add Badge Image to Push Notification #8012 @tamaina diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 743640725..1f52c2c25 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1246,6 +1246,7 @@ _widgets: trends: "トレンド" clock: "時計" rss: "RSSリーダー" + rssMarquee: "RSSリーダー(マーキー)" activity: "アクティビティ" photos: "フォト" digitalClock: "デジタル時計" diff --git a/packages/client/package.json b/packages/client/package.json index 56467fc84..54ee7dee5 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -76,6 +76,7 @@ "vanilla-tilt": "1.7.2", "vite": "3.0.0-beta.5", "vue": "3.2.37", + "vue-marquee-text-component": "2.0.1", "vue-prism-editor": "2.0.0-alpha.2", "vuedraggable": "4.0.1", "websocket": "1.0.34", diff --git a/packages/client/src/widgets/index.ts b/packages/client/src/widgets/index.ts index feda16c91..ed65f5291 100644 --- a/packages/client/src/widgets/index.ts +++ b/packages/client/src/widgets/index.ts @@ -6,6 +6,7 @@ export default function(app: App) { app.component('MkwTimeline', defineAsyncComponent(() => import('./timeline.vue'))); app.component('MkwCalendar', defineAsyncComponent(() => import('./calendar.vue'))); app.component('MkwRss', defineAsyncComponent(() => import('./rss.vue'))); + app.component('MkwRssMarquee', defineAsyncComponent(() => import('./rss-marquee.vue'))); app.component('MkwTrends', defineAsyncComponent(() => import('./trends.vue'))); app.component('MkwClock', defineAsyncComponent(() => import('./clock.vue'))); app.component('MkwActivity', defineAsyncComponent(() => import('./activity.vue'))); @@ -29,13 +30,14 @@ export const widgets = [ 'timeline', 'calendar', 'rss', + 'rssMarquee', 'trends', 'clock', 'activity', 'photos', 'digitalClock', 'federation', - 'instance-cloud', + 'instanceCloud', 'postForm', 'slideshow', 'serverMetric', diff --git a/packages/client/src/widgets/rss-marquee.vue b/packages/client/src/widgets/rss-marquee.vue new file mode 100644 index 000000000..e23f916d3 --- /dev/null +++ b/packages/client/src/widgets/rss-marquee.vue @@ -0,0 +1,115 @@ + + + + + diff --git a/packages/client/src/widgets/rss.vue b/packages/client/src/widgets/rss.vue index e5da291a8..ea896478a 100644 --- a/packages/client/src/widgets/rss.vue +++ b/packages/client/src/widgets/rss.vue @@ -6,7 +6,7 @@
@@ -23,14 +23,14 @@ import { useInterval } from '@/scripts/use-interval'; const name = 'rss'; const widgetPropsDef = { - showHeader: { - type: 'boolean' as const, - default: true, - }, url: { type: 'string' as const, default: 'http://feeds.afpbb.com/rss/afpbb/afpbbnews', }, + showHeader: { + type: 'boolean' as const, + default: true, + }, }; type WidgetProps = GetFormResultType; @@ -79,7 +79,7 @@ defineExpose({ padding: 0; font-size: 0.9em; - > a { + > .item { display: block; padding: 8px 16px; color: var(--fg); diff --git a/packages/client/yarn.lock b/packages/client/yarn.lock index 7bbbe08d3..58df1576f 100644 --- a/packages/client/yarn.lock +++ b/packages/client/yarn.lock @@ -1221,6 +1221,11 @@ content-disposition@0.5.4: dependencies: safe-buffer "5.2.1" +core-js@^3.18.0: + version "3.23.3" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.23.3.tgz#3b977612b15da6da0c9cc4aec487e8d24f371112" + integrity sha512-oAKwkj9xcWNBAvGbT//WiCdOMpb9XQG92/Fe3ABFM/R16BsHgePG00mFOgKf7IsCtfj8tA1kHtf/VwErhriz5Q== + core-util-is@1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" @@ -4252,12 +4257,20 @@ vue-eslint-parser@^9.0.1: lodash "^4.17.21" semver "^7.3.6" +vue-marquee-text-component@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/vue-marquee-text-component/-/vue-marquee-text-component-2.0.1.tgz#62691df195f755471fa9bdc9b1969f836a922b9a" + integrity sha512-dbeRwDY5neOJcWZrDFU2tJMhPSsxN25ZpNYeZdt0jkseg1MbyGKzrfEH9nrCFZRkEfqhxG+ukyzwVwR9US5sTQ== + dependencies: + core-js "^3.18.0" + vue "^3.2.19" + vue-prism-editor@2.0.0-alpha.2: version "2.0.0-alpha.2" resolved "https://registry.yarnpkg.com/vue-prism-editor/-/vue-prism-editor-2.0.0-alpha.2.tgz#aa53a88efaaed628027cbb282c2b1d37fc7c5c69" integrity sha512-Gu42ba9nosrE+gJpnAEuEkDMqG9zSUysIR8SdXUw8MQKDjBnnNR9lHC18uOr/ICz7yrA/5c7jHJr9lpElODC7w== -vue@3.2.37: +vue@3.2.37, vue@^3.2.19: version "3.2.37" resolved "https://registry.yarnpkg.com/vue/-/vue-3.2.37.tgz#da220ccb618d78579d25b06c7c21498ca4e5452e" integrity sha512-bOKEZxrm8Eh+fveCqS1/NkG/n6aMidsI6hahas7pa0w/l7jkbssJVsRhVDs07IdDq7h9KHswZOgItnwJAgtVtQ==