From 8adb9f403b2c323b9e9fae97866fc4b7016be8bb Mon Sep 17 00:00:00 2001 From: patak Date: Tue, 17 Jan 2023 10:59:16 +0100 Subject: [PATCH] feat: StackBlitz code block expansion (#1240) Co-authored-by: Daniel Roe --- components/status/StatusPreviewCard.vue | 67 +------------ components/status/StatusPreviewCardNormal.vue | 78 ++++++++++++++++ components/status/StatusPreviewStackBlitz.vue | 93 +++++++++++++++++++ 3 files changed, 174 insertions(+), 64 deletions(-) create mode 100644 components/status/StatusPreviewCardNormal.vue create mode 100644 components/status/StatusPreviewStackBlitz.vue diff --git a/components/status/StatusPreviewCard.vue b/components/status/StatusPreviewCard.vue index 2b0cdb8c..9eb68522 100644 --- a/components/status/StatusPreviewCard.vue +++ b/components/status/StatusPreviewCard.vue @@ -9,74 +9,13 @@ const props = defineProps<{ root?: boolean }>() -// mastodon's default max og image width -const ogImageWidth = 400 - -const alt = $computed(() => `${props.card.title} - ${props.card.title}`) -const isSquare = $computed(() => ( - props.smallPictureOnly - || props.card.width === props.card.height - || Number(props.card.width || 0) < ogImageWidth - || Number(props.card.height || 0) < ogImageWidth / 2 -)) const providerName = $computed(() => props.card.providerName ? props.card.providerName : new URL(props.card.url).hostname) const gitHubCards = $(usePreferences('experimentalGitHubCards')) - -// TODO: handle card.type: 'photo' | 'video' | 'rich'; -const cardTypeIconMap: Record = { - link: 'i-ri:profile-line', - photo: 'i-ri:image-line', - video: 'i-ri:play-line', - rich: 'i-ri:profile-line', -} diff --git a/components/status/StatusPreviewCardNormal.vue b/components/status/StatusPreviewCardNormal.vue new file mode 100644 index 00000000..4907630d --- /dev/null +++ b/components/status/StatusPreviewCardNormal.vue @@ -0,0 +1,78 @@ + + + diff --git a/components/status/StatusPreviewStackBlitz.vue b/components/status/StatusPreviewStackBlitz.vue new file mode 100644 index 00000000..e26c0aba --- /dev/null +++ b/components/status/StatusPreviewStackBlitz.vue @@ -0,0 +1,93 @@ + + + + +