forked from mirrors/misskey
* wip
* wip
* wip
* wip
* Update MkTimeline.vue
* wip
* wip
* wip
* Update MkTimeline.vue
* Update use-pagination.ts
* wip
* wip
* Update MkTimeline.vue
* Update MkTimeline.vue
* wip
* wip
* Update MkTimeline.vue
* Update MkTimeline.vue
* Update MkTimeline.vue
* wip
* Update use-pagination.ts
* wip
* Update use-pagination.ts
* Update MkNotifications.vue
* Update MkNotifications.vue
* wip
* wip
* wip
* Update use-note-capture.ts
* Update use-note-capture.ts
* Update use-note-capture.ts
* wip
* wip
* wip
* wip
* Update MkNoteDetailed.vue
* wip
* wip
* Update MkTimeline.vue
* wip
* fix
* Update MkTimeline.vue
* wip
* test
* Revert "test"
This reverts commit 3375619396c54dcda5e564eb1da444c2391208c9.
* Update use-pagination.ts
* test
* Revert "test"
This reverts commit 42c53c830e28485d2fb49061fa7cdeee31bc6a22.
* test
* Revert "test"
This reverts commit c4f8cda4aa1cec9d1eb97557145f3ad3d2d0e469.
* Update style.scss
* Update MkTimeline.vue
* Update MkTimeline.vue
* Update MkTimeline.vue
* ✌️
* Update MkTimeline.vue
* wip
* wip
* test
* Update MkPullToRefresh.vue
* Update MkPullToRefresh.vue
* Update MkPullToRefresh.vue
* Update MkPullToRefresh.vue
* Update MkTimeline.vue
* wip
* tweak navbar
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* Update home.vue
* wip
* refactor
* wip
* wip
* Update note.vue
* Update navbar.vue
* Update MkPullToRefresh.vue
* Update MkPullToRefresh.vue
* Update MkPullToRefresh.vue
* wip
* Update MkStreamingNotificationsTimeline.vue
* Update use-pagination.ts
* wip
* improve perf
* wip
* Update MkNotesTimeline.vue
* wip
* megre
* Update use-pagination.ts
* Update use-pagination.ts
* Update MkStreamingNotesTimeline.vue
* Update use-pagination.ts
* Update CHANGELOG.md
* Update CHANGELOG.md
* Update CHANGELOG.md
116 lines
3.4 KiB
Vue
116 lines
3.4 KiB
Vue
<!--
|
|
SPDX-FileCopyrightText: syuilo and misskey-project
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
-->
|
|
|
|
<template>
|
|
<div v-if="phase === 'aboutNote'" class="_gaps">
|
|
<div style="text-align: center; padding: 0 16px;">{{ i18n.ts._initialTutorial._note.description }}</div>
|
|
<MkNote :class="$style.exampleNoteRoot" style="pointer-events: none;" :note="exampleNote" :mock="true"/>
|
|
<div class="_gaps_s">
|
|
<div><i class="ti ti-arrow-back-up"></i> <b>{{ i18n.ts.reply }}</b> … {{ i18n.ts._initialTutorial._note.reply }}</div>
|
|
<div><i class="ti ti-repeat"></i> <b>{{ i18n.ts.renote }}</b> … {{ i18n.ts._initialTutorial._note.renote }}</div>
|
|
<div><i class="ti ti-plus"></i> <b>{{ i18n.ts.reaction }}</b> … {{ i18n.ts._initialTutorial._note.reaction }}</div>
|
|
<div><i class="ti ti-dots"></i> <b>{{ i18n.ts.menu }}</b> … {{ i18n.ts._initialTutorial._note.menu }}</div>
|
|
</div>
|
|
</div>
|
|
<div v-else-if="phase === 'howToReact'" class="_gaps">
|
|
<div style="text-align: center; padding: 0 16px;">{{ i18n.ts._initialTutorial._reaction.description }}</div>
|
|
<div>{{ i18n.ts._initialTutorial._reaction.letsTryReacting }}</div>
|
|
<MkNote :class="$style.exampleNoteRoot" :note="exampleNote" :mock="true" @reaction="addReaction" @removeReaction="removeReaction"/>
|
|
<div v-if="onceReacted"><b style="color: var(--MI_THEME-accent);"><i class="ti ti-check"></i> {{ i18n.ts._initialTutorial.wellDone }}</b> {{ i18n.ts._initialTutorial._reaction.reactNotification }}<br>{{ i18n.ts._initialTutorial._reaction.reactDone }}</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import * as Misskey from 'misskey-js';
|
|
import { ref, reactive } from 'vue';
|
|
import { i18n } from '@/i18n.js';
|
|
import { globalEvents } from '@/events.js';
|
|
import { $i } from '@/i.js';
|
|
import MkNote from '@/components/MkNote.vue';
|
|
|
|
const props = defineProps<{
|
|
phase: 'aboutNote' | 'howToReact';
|
|
}>();
|
|
|
|
const emit = defineEmits<{
|
|
(ev: 'reacted'): void;
|
|
}>();
|
|
|
|
const exampleNote = reactive<Misskey.entities.Note>({
|
|
id: '0000000000',
|
|
createdAt: '2019-04-14T17:30:49.181Z',
|
|
userId: '0000000001',
|
|
user: {
|
|
id: '0000000001',
|
|
name: '藍',
|
|
username: 'ai',
|
|
host: null,
|
|
avatarDecorations: [],
|
|
avatarUrl: '/client-assets/tutorial/ai.webp',
|
|
avatarBlurhash: 'eiKmhHIByXxZ~qWXs:-pR*NbR*s:xuRjoL-oR*WCt6WWf6WVf6oeWB',
|
|
isBot: false,
|
|
isCat: true,
|
|
emojis: {},
|
|
onlineStatus: 'unknown',
|
|
badgeRoles: [],
|
|
},
|
|
text: 'just setting up my msky',
|
|
cw: null,
|
|
visibility: 'public',
|
|
localOnly: false,
|
|
reactionAcceptance: null,
|
|
renoteCount: 0,
|
|
repliesCount: 1,
|
|
reactionCount: 0,
|
|
reactions: {},
|
|
reactionEmojis: {},
|
|
fileIds: [],
|
|
files: [],
|
|
replyId: null,
|
|
renoteId: null,
|
|
});
|
|
const onceReacted = ref<boolean>(false);
|
|
|
|
function addReaction(emoji) {
|
|
onceReacted.value = true;
|
|
emit('reacted');
|
|
doNotification(emoji);
|
|
}
|
|
|
|
function doNotification(emoji: string): void {
|
|
if (!$i || !emoji) return;
|
|
|
|
const notification: Misskey.entities.Notification = {
|
|
id: Math.random().toString(),
|
|
createdAt: new Date().toUTCString(),
|
|
type: 'reaction',
|
|
reaction: emoji,
|
|
user: $i,
|
|
userId: $i.id,
|
|
note: exampleNote,
|
|
};
|
|
|
|
globalEvents.emit('clientNotification', notification);
|
|
}
|
|
|
|
function removeReaction(emoji) {
|
|
delete exampleNote.reactions[emoji];
|
|
exampleNote.myReaction = undefined;
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss" module>
|
|
.exampleNoteRoot {
|
|
border-radius: var(--MI-radius);
|
|
border: var(--MI_THEME-panelBorder);
|
|
background: var(--MI_THEME-panel);
|
|
}
|
|
|
|
.divider {
|
|
height: 1px;
|
|
background: var(--MI_THEME-divider);
|
|
}
|
|
</style>
|