mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-07-07 20:44:34 +00:00
add DynamicNoteDetailed.vue
This commit is contained in:
parent
d272d6f224
commit
61019158ce
3 changed files with 44 additions and 9 deletions
|
@ -670,6 +670,7 @@ seems to do a decent job)
|
||||||
* from `packages/frontend/src/components/MkNoteSub.vue` to `packages/frontend/src/components/SkNoteSub.vue`
|
* from `packages/frontend/src/components/MkNoteSub.vue` to `packages/frontend/src/components/SkNoteSub.vue`
|
||||||
* from MK note components to Dynamic note components (if the public signature changed)
|
* from MK note components to Dynamic note components (if the public signature changed)
|
||||||
* from `packages/frontend/src/components/MkNote.vue` to `packages/frontend/src/components/DynamicNote.vue`
|
* from `packages/frontend/src/components/MkNote.vue` to `packages/frontend/src/components/DynamicNote.vue`
|
||||||
|
* from `packages/frontend/src/components/MkNoteDetailed.vue` to `packages/frontend/src/components/DynamicNoteDetailed.vue`
|
||||||
* from the global timeline to the bubble timeline
|
* from the global timeline to the bubble timeline
|
||||||
* `packages/backend/src/server/api/stream/channels/global-timeline.ts`
|
* `packages/backend/src/server/api/stream/channels/global-timeline.ts`
|
||||||
* `packages/backend/src/server/api/stream/channels/bubble-timeline.ts`
|
* `packages/backend/src/server/api/stream/channels/bubble-timeline.ts`
|
||||||
|
|
40
packages/frontend/src/components/DynamicNoteDetailed.vue
Normal file
40
packages/frontend/src/components/DynamicNoteDetailed.vue
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
<!--
|
||||||
|
SPDX-FileCopyrightText: hazelnoot and other Sharkey contributors
|
||||||
|
SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
-->
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<XNoteDetailed
|
||||||
|
ref="rootEl"
|
||||||
|
:note="note"
|
||||||
|
:initialTab="initialTab"
|
||||||
|
:expandAllCws="expandAllCws"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import * as Misskey from 'misskey-js';
|
||||||
|
import { computed, defineAsyncComponent, shallowRef } from 'vue';
|
||||||
|
import type { ComponentExposed } from 'vue-component-type-helpers';
|
||||||
|
import type MkNoteDetailed from '@/components/MkNoteDetailed.vue';
|
||||||
|
import type SkNoteDetailed from '@/components/SkNoteDetailed.vue';
|
||||||
|
import { prefer } from '@/preferences';
|
||||||
|
|
||||||
|
const XNoteDetailed = computed(() =>
|
||||||
|
defineAsyncComponent(() =>
|
||||||
|
prefer.r.noteDesign.value === 'misskey'
|
||||||
|
? import('@/components/MkNoteDetailed.vue')
|
||||||
|
: import('@/components/SkNoteDetailed.vue'),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
const rootEl = shallowRef<ComponentExposed<typeof MkNoteDetailed | typeof SkNoteDetailed>>();
|
||||||
|
|
||||||
|
defineExpose({ rootEl });
|
||||||
|
|
||||||
|
defineProps<{
|
||||||
|
note: Misskey.entities.Note;
|
||||||
|
initialTab?: string;
|
||||||
|
expandAllCws?: boolean;
|
||||||
|
}>();
|
||||||
|
</script>
|
|
@ -21,7 +21,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
<div class="_margin _gaps_s">
|
<div class="_margin _gaps_s">
|
||||||
<MkRemoteCaution v-if="note.user.host != null" :href="note.url ?? note.uri"/>
|
<MkRemoteCaution v-if="note.user.host != null" :href="note.url ?? note.uri"/>
|
||||||
<SkErrorList :errors="note.processErrors"/>
|
<SkErrorList :errors="note.processErrors"/>
|
||||||
<MkNoteDetailed :key="note.id" v-model:note="note" :initialTab="initialTab" :class="$style.note" :expandAllCws="expandAllCws"/>
|
<DynamicNoteDetailed :key="note.id" v-model:note="note" :initialTab="initialTab" :class="$style.note" :expandAllCws="expandAllCws"/>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="clips && clips.length > 0" class="_margin">
|
<div v-if="clips && clips.length > 0" class="_margin">
|
||||||
<div style="font-weight: bold; padding: 12px;">{{ i18n.ts.clip }}</div>
|
<div style="font-weight: bold; padding: 12px;">{{ i18n.ts.clip }}</div>
|
||||||
|
@ -48,7 +48,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { defineAsyncComponent, computed, watch, ref } from 'vue';
|
import { computed, watch, ref } from 'vue';
|
||||||
import * as Misskey from 'misskey-js';
|
import * as Misskey from 'misskey-js';
|
||||||
import { host } from '@@/js/config.js';
|
import { host } from '@@/js/config.js';
|
||||||
import type { Paging } from '@/components/MkPagination.vue';
|
import type { Paging } from '@/components/MkPagination.vue';
|
||||||
|
@ -66,17 +66,11 @@ import { pleaseLogin } from '@/utility/please-login.js';
|
||||||
import { getAppearNote } from '@/utility/get-appear-note.js';
|
import { getAppearNote } from '@/utility/get-appear-note.js';
|
||||||
import { serverContext, assertServerContext } from '@/server-context.js';
|
import { serverContext, assertServerContext } from '@/server-context.js';
|
||||||
import { $i } from '@/i.js';
|
import { $i } from '@/i.js';
|
||||||
|
import DynamicNoteDetailed from '@/components/DynamicNoteDetailed.vue';
|
||||||
|
|
||||||
// contextは非ログイン状態の情報しかないためログイン時は利用できない
|
// contextは非ログイン状態の情報しかないためログイン時は利用できない
|
||||||
const CTX_NOTE = !$i && assertServerContext(serverContext, 'note') ? serverContext.note : null;
|
const CTX_NOTE = !$i && assertServerContext(serverContext, 'note') ? serverContext.note : null;
|
||||||
|
|
||||||
// TODO DynamicNoteDetailed
|
|
||||||
const MkNoteDetailed = defineAsyncComponent(() =>
|
|
||||||
(prefer.s.noteDesign === 'misskey')
|
|
||||||
? import('@/components/MkNoteDetailed.vue')
|
|
||||||
: import('@/components/SkNoteDetailed.vue'),
|
|
||||||
);
|
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
noteId: string;
|
noteId: string;
|
||||||
initialTab?: string;
|
initialTab?: string;
|
||||||
|
|
Loading…
Add table
Reference in a new issue