From 73842166eedc8d2aa71afc691de1e237da6e046a 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/src/components/MkNote.vue | 19 +----- .../frontend/src/components/MkNoteSimple.vue | 16 ++++- .../frontend/src/components/MkUrlPreview.vue | 55 ++++++++++++++--- packages/frontend/test/url-preview.test.ts | 59 ++++++++++++++++--- 6 files changed, 117 insertions(+), 34 deletions(-) diff --git a/locales/index.d.ts b/locales/index.d.ts index 60e88a2192..3e34c6a813 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -609,6 +609,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 3d31dcef49..b1838fa5ab 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -606,6 +606,7 @@ useCw: "内容を隠す" enablePlayer: "プレイヤーを開く" disablePlayer: "プレイヤーを閉じる" expandTweet: "ポストを展開する" +expandNote: "ノートを展開する" themeEditor: "テーマエディター" description: "説明" describeFile: "キャプションを付ける" diff --git a/packages/frontend/src/components/MkNote.vue b/packages/frontend/src/components/MkNote.vue index 7d4207f0fb..515a002680 100644 --- a/packages/frontend/src/components/MkNote.vue +++ b/packages/frontend/src/components/MkNote.vue @@ -83,7 +83,7 @@ SPDX-License-Identifier: AGPL-3.0-only -
+ @@ -800,17 +800,6 @@ function emitUpdReaction(emoji: string, delta: number) { 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%; @@ -947,12 +936,6 @@ function emitUpdReaction(emoji: string, delta: number) { } } -@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 e7cb3f96f1..4488cdcff3 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 --> -