1
1
mirror of https://github.com/kokonect-link/cherrypick synced 2024-11-30 15:58:19 +09:00

fix(frontend): ページデザインの修正 (#13642)

This commit is contained in:
かっこかり 2024-03-31 14:16:42 +09:00 committed by GitHub
parent efafa02f68
commit 61978cb4ca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 69 additions and 2 deletions

8
locales/index.d.ts vendored
View File

@ -8830,6 +8830,14 @@ export interface Locale extends ILocale {
*
*/
"button": string;
/**
*
*/
"dynamic": string;
/**
* {play}
*/
"dynamicDescription": ParameterizedString<"play">;
/**
*
*/

View File

@ -2331,6 +2331,8 @@ _pages:
section: "セクション"
image: "画像"
button: "ボタン"
dynamic: "動的ブロック"
dynamicDescription: "このブロックは廃止されています。今後は{play}を利用してください。"
note: "ノート埋め込み"
_note:
@ -2625,4 +2627,3 @@ _mediaControls:
pip: "ピクチャインピクチャ"
playbackRate: "再生速度"
loop: "ループ再生"

View File

@ -14,6 +14,7 @@ import XText from './page.text.vue';
import XSection from './page.section.vue';
import XImage from './page.image.vue';
import XNote from './page.note.vue';
import XDynamic from './page.dynamic.vue';
function getComponent(type: string) {
switch (type) {
@ -21,6 +22,20 @@ function getComponent(type: string) {
case 'section': return XSection;
case 'image': return XImage;
case 'note': return XNote;
//
case 'button':
case 'if':
case 'textarea':
case 'post':
case 'canvas':
case 'numberInput':
case 'textInput':
case 'switch':
case 'radioButton':
case 'counter':
return XDynamic;
default: return null;
}
}

View File

@ -0,0 +1,43 @@
<!--
SPDX-FileCopyrightText: syuilo and misskey-project
SPDX-License-Identifier: AGPL-3.0-only
-->
<!-- 動的ページのブロックの代替利用できないということを表示する -->
<template>
<div :class="$style.root">
<div :class="$style.heading"><i class="ti ti-dice-5"></i> {{ i18n.ts._pages.blocks.dynamic }}</div>
<I18n :src="i18n.ts._pages.blocks.dynamicDescription" tag="div" :class="$style.text">
<template #play>
<MkA to="/play" class="_link">Play</MkA>
</template>
</I18n>
</div>
</template>
<script lang="ts" setup>
import * as Misskey from 'misskey-js';
import { i18n } from '@/i18n.js';
const props = defineProps<{
block: Misskey.entities.PageBlock,
page: Misskey.entities.Page,
}>();
</script>
<style lang="scss" module>
.root {
border: 1px solid var(--divider);
border-radius: var(--radius);
padding: var(--margin);
text-align: center;
}
.heading {
font-weight: 700;
}
.text {
font-size: 90%;
}
</style>

View File

@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<template>
<div class="_gaps" :class="$style.textRoot">
<Mfm :text="block.text ?? ''" :isNote="false"/>
<div v-if="isEnabledUrlPreview">
<div v-if="isEnabledUrlPreview" class="_gaps_s">
<MkUrlPreview v-for="url in urls" :key="url" :url="url"/>
</div>
</div>