From 47986eb6f508c3ee8a8666b30306794c03cb2431 Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Sun, 6 Aug 2023 22:44:00 +0200 Subject: [PATCH] feat(frontend/MkUrlPreview): support expanding ActivityPub notes --- locales/index.d.ts | 1 + locales/ja-JP.yml | 1 + packages/frontend/package.json | 2 +- packages/frontend/src/components/MkNote.vue | 19 +--- .../frontend/src/components/MkNoteSimple.vue | 15 ++- .../frontend/src/components/MkUrlPreview.vue | 99 +++++++++++++------ packages/frontend/test/url-preview.test.ts | 57 +++++++++-- pnpm-lock.yaml | 2 +- 8 files changed, 136 insertions(+), 60 deletions(-) diff --git a/locales/index.d.ts b/locales/index.d.ts index 4dceec6050..3ec926b92f 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -589,6 +589,7 @@ export interface Locale { "enablePlayer": string; "disablePlayer": string; "expandTweet": string; + "expandNote": string; "themeEditor": string; "description": string; "describeFile": string; diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index cab5c8f97a..d31db56fd4 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -586,6 +586,7 @@ useCw: "内容を隠す" enablePlayer: "プレイヤーを開く" disablePlayer: "プレイヤーを閉じる" expandTweet: "ツイートを展開する" +expandNote: "ノートを展開する" themeEditor: "テーマエディター" description: "説明" describeFile: "キャプションを付ける" diff --git a/packages/frontend/package.json b/packages/frontend/package.json index 7d3c8b9767..79a6a5b203 100644 --- a/packages/frontend/package.json +++ b/packages/frontend/package.json @@ -134,7 +134,7 @@ "start-server-and-test": "2.0.0", "storybook": "7.0.27", "storybook-addon-misskey-theme": "github:misskey-dev/storybook-addon-misskey-theme", - "summaly": "github:misskey-dev/summaly", + "summaly": "github:misskey-dev/summaly#d2d8db49943ccb201c1b1b283e9d0a630519fac7", "vite-plugin-turbosnap": "1.0.2", "vitest": "0.33.0", "vitest-fetch-mock": "0.2.2", diff --git a/packages/frontend/src/components/MkNote.vue b/packages/frontend/src/components/MkNote.vue index 6cd1a4c4b5..a6e1058992 100644 --- a/packages/frontend/src/components/MkNote.vue +++ b/packages/frontend/src/components/MkNote.vue @@ -74,7 +74,7 @@ SPDX-License-Identifier: AGPL-3.0-only -
+ @@ -758,17 +758,6 @@ function showReactions(): void { font-size: 80%; } -.quote { - padding: 8px 0; -} - -.quoteNote { - padding: 16px; - border: dashed 1px var(--renote); - border-radius: 8px; - overflow: clip; -} - .channel { opacity: 0.7; font-size: 80%; @@ -905,12 +894,6 @@ function showReactions(): void { } } -@container (max-width: 250px) { - .quoteNote { - padding: 12px; - } -} - .muted { padding: 8px; text-align: center; diff --git a/packages/frontend/src/components/MkNoteSimple.vue b/packages/frontend/src/components/MkNoteSimple.vue index 9648b7230a..c6c843acd2 100644 --- a/packages/frontend/src/components/MkNoteSimple.vue +++ b/packages/frontend/src/components/MkNoteSimple.vue @@ -4,7 +4,7 @@ SPDX-License-Identifier: AGPL-3.0-only --> -