refactor: move to global
This commit is contained in:
parent
d7428a1577
commit
48b37e0c94
|
@ -13,7 +13,6 @@ import * as os from '@/os.js';
|
||||||
import { instance } from '@/instance.js';
|
import { instance } from '@/instance.js';
|
||||||
import { prefer } from '@/preferences.js';
|
import { prefer } from '@/preferences.js';
|
||||||
import { getDateText } from '@/utility/timeline-date-separate.js';
|
import { getDateText } from '@/utility/timeline-date-separate.js';
|
||||||
import SkTransitionGroup from '@/components/SkTransitionGroup.vue';
|
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
props: {
|
props: {
|
||||||
|
|
|
@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div ref="root" :class="['chromatic-ignore', $style.root, { [$style.cover]: cover }]" :title="title ?? ''">
|
<div ref="root" :class="['chromatic-ignore', $style.root, { [$style.cover]: cover }]" :title="title ?? ''">
|
||||||
<SkTransitionGroup
|
<MkTransitionGroup
|
||||||
:animate="prefer.s.animation && props.transition != null"
|
:animate="prefer.s.animation && props.transition != null"
|
||||||
:duration="props.transition?.duration"
|
:duration="props.transition?.duration"
|
||||||
:enterActiveClass="props.transition?.enterActiveClass"
|
:enterActiveClass="props.transition?.enterActiveClass"
|
||||||
|
@ -43,7 +43,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
tabindex="-1"
|
tabindex="-1"
|
||||||
style="-webkit-user-drag: none;"
|
style="-webkit-user-drag: none;"
|
||||||
/>
|
/>
|
||||||
</SkTransitionGroup>
|
</MkTransitionGroup>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -86,7 +86,6 @@ import { computed, nextTick, onMounted, onUnmounted, useTemplateRef, watch, ref
|
||||||
import { v4 as uuid } from 'uuid';
|
import { v4 as uuid } from 'uuid';
|
||||||
import { render } from 'buraha';
|
import { render } from 'buraha';
|
||||||
import { prefer } from '@/preferences.js';
|
import { prefer } from '@/preferences.js';
|
||||||
import SkTransitionGroup from '@/components/SkTransitionGroup.vue';
|
|
||||||
|
|
||||||
const props = withDefaults(defineProps<{
|
const props = withDefaults(defineProps<{
|
||||||
transition?: {
|
transition?: {
|
||||||
|
|
|
@ -4,7 +4,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<SkTransitionGroup
|
<MkTransitionGroup
|
||||||
:enterActiveClass="$style.transition_x_enterActive"
|
:enterActiveClass="$style.transition_x_enterActive"
|
||||||
:leaveActiveClass="$style.transition_x_leaveActive"
|
:leaveActiveClass="$style.transition_x_leaveActive"
|
||||||
:enterFromClass="$style.transition_x_enterFrom"
|
:enterFromClass="$style.transition_x_enterFrom"
|
||||||
|
@ -24,7 +24,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
@reactionToggled="onMockToggleReaction"
|
@reactionToggled="onMockToggleReaction"
|
||||||
/>
|
/>
|
||||||
<slot v-if="hasMoreReactions" :key="'$more'" name="more"/>
|
<slot v-if="hasMoreReactions" :key="'$more'" name="more"/>
|
||||||
</SkTransitionGroup>
|
</MkTransitionGroup>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
@ -34,7 +34,6 @@ import { TransitionGroup } from 'vue';
|
||||||
import XReaction from '@/components/MkReactionsViewer.reaction.vue';
|
import XReaction from '@/components/MkReactionsViewer.reaction.vue';
|
||||||
import { prefer } from '@/preferences.js';
|
import { prefer } from '@/preferences.js';
|
||||||
import { DI } from '@/di.js';
|
import { DI } from '@/di.js';
|
||||||
import SkTransitionGroup from '@/components/SkTransitionGroup.vue';
|
|
||||||
|
|
||||||
const props = withDefaults(defineProps<{
|
const props = withDefaults(defineProps<{
|
||||||
noteId: Misskey.entities.Note['id'];
|
noteId: Misskey.entities.Note['id'];
|
||||||
|
|
|
@ -35,7 +35,7 @@ interface SkTransitionGroupProps extends TransitionGroupProps {
|
||||||
animate?: boolean | undefined | null;
|
animate?: boolean | undefined | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
const props = withDefaults(defineProps<SkTransitionGroupProps>(), {
|
const props = withDefaults(defineProps<MkTransitionGroupProps>(), {
|
||||||
tag: 'div',
|
tag: 'div',
|
||||||
class: undefined,
|
class: undefined,
|
||||||
animate: undefined,
|
animate: undefined,
|
|
@ -4,7 +4,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<SkTransitionGroup
|
<MkTransitionGroup
|
||||||
:enterActiveClass="$style.transition_x_enterActive"
|
:enterActiveClass="$style.transition_x_enterActive"
|
||||||
:leaveActiveClass="$style.transition_x_leaveActive"
|
:leaveActiveClass="$style.transition_x_leaveActive"
|
||||||
:enterFromClass="$style.transition_x_enterFrom"
|
:enterFromClass="$style.transition_x_enterFrom"
|
||||||
|
@ -37,7 +37,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</SkTransitionGroup>
|
</MkTransitionGroup>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
@ -47,7 +47,6 @@ import { prefer } from '@/preferences.js';
|
||||||
import MkLoadingPage from '@/pages/_loading_.vue';
|
import MkLoadingPage from '@/pages/_loading_.vue';
|
||||||
import { DI } from '@/di.js';
|
import { DI } from '@/di.js';
|
||||||
import { deepEqual } from '@/utility/deep-equal.js';
|
import { deepEqual } from '@/utility/deep-equal.js';
|
||||||
import SkTransitionGroup from '@/components/SkTransitionGroup.vue';
|
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
router?: Router;
|
router?: Router;
|
||||||
|
|
|
@ -27,6 +27,7 @@ import MkLazy from './global/MkLazy.vue';
|
||||||
import MkResult from './global/MkResult.vue';
|
import MkResult from './global/MkResult.vue';
|
||||||
import MkSystemIcon from './global/MkSystemIcon.vue';
|
import MkSystemIcon from './global/MkSystemIcon.vue';
|
||||||
import MkTip from './global/MkTip.vue';
|
import MkTip from './global/MkTip.vue';
|
||||||
|
import MkTransitionGroup from './global/MkTransitionGroup.vue';
|
||||||
import PageWithHeader from './global/PageWithHeader.vue';
|
import PageWithHeader from './global/PageWithHeader.vue';
|
||||||
import PageWithAnimBg from './global/PageWithAnimBg.vue';
|
import PageWithAnimBg from './global/PageWithAnimBg.vue';
|
||||||
import SearchMarker from './global/SearchMarker.vue';
|
import SearchMarker from './global/SearchMarker.vue';
|
||||||
|
@ -67,6 +68,7 @@ export const components = {
|
||||||
MkResult: MkResult,
|
MkResult: MkResult,
|
||||||
MkSystemIcon: MkSystemIcon,
|
MkSystemIcon: MkSystemIcon,
|
||||||
MkTip: MkTip,
|
MkTip: MkTip,
|
||||||
|
MkTransitionGroup: MkTransitionGroup,
|
||||||
PageWithHeader: PageWithHeader,
|
PageWithHeader: PageWithHeader,
|
||||||
PageWithAnimBg: PageWithAnimBg,
|
PageWithAnimBg: PageWithAnimBg,
|
||||||
SearchMarker: SearchMarker,
|
SearchMarker: SearchMarker,
|
||||||
|
@ -101,6 +103,7 @@ declare module '@vue/runtime-core' {
|
||||||
MkResult: typeof MkResult;
|
MkResult: typeof MkResult;
|
||||||
MkSystemIcon: typeof MkSystemIcon;
|
MkSystemIcon: typeof MkSystemIcon;
|
||||||
MkTip: typeof MkTip;
|
MkTip: typeof MkTip;
|
||||||
|
MkTransitionGroup: typeof MkTransitionGroup;
|
||||||
PageWithHeader: typeof PageWithHeader;
|
PageWithHeader: typeof PageWithHeader;
|
||||||
PageWithAnimBg: typeof PageWithAnimBg;
|
PageWithAnimBg: typeof PageWithAnimBg;
|
||||||
SearchMarker: typeof SearchMarker;
|
SearchMarker: typeof SearchMarker;
|
||||||
|
|
|
@ -28,7 +28,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
<MkA v-if="isSearchResult && 'toRoom' in message && message.toRoom != null" :to="`/chat/room/${message.toRoomId}`">{{ message.toRoom.name }}</MkA>
|
<MkA v-if="isSearchResult && 'toRoom' in message && message.toRoom != null" :to="`/chat/room/${message.toRoomId}`">{{ message.toRoom.name }}</MkA>
|
||||||
<MkA v-if="isSearchResult && 'toUser' in message && message.toUser != null && isMe" :to="`/chat/user/${message.toUserId}`">@{{ message.toUser.username }}</MkA>
|
<MkA v-if="isSearchResult && 'toUser' in message && message.toUser != null && isMe" :to="`/chat/user/${message.toUserId}`">@{{ message.toUser.username }}</MkA>
|
||||||
</div>
|
</div>
|
||||||
<SkTransitionGroup
|
<MkTransitionGroup
|
||||||
:enterActiveClass="$style.transition_reaction_enterActive"
|
:enterActiveClass="$style.transition_reaction_enterActive"
|
||||||
:leaveActiveClass="$style.transition_reaction_leaveActive"
|
:leaveActiveClass="$style.transition_reaction_leaveActive"
|
||||||
:enterFromClass="$style.transition_reaction_enterFrom"
|
:enterFromClass="$style.transition_reaction_enterFrom"
|
||||||
|
@ -45,7 +45,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
:class="$style.reactionIcon"
|
:class="$style.reactionIcon"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</SkTransitionGroup>
|
</MkTransitionGroup>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -73,7 +73,6 @@ import MkReactionIcon from '@/components/MkReactionIcon.vue';
|
||||||
import { prefer } from '@/preferences.js';
|
import { prefer } from '@/preferences.js';
|
||||||
import { DI } from '@/di.js';
|
import { DI } from '@/di.js';
|
||||||
import { getHTMLElementOrNull } from '@/utility/get-dom-node-or-null.js';
|
import { getHTMLElementOrNull } from '@/utility/get-dom-node-or-null.js';
|
||||||
import SkTransitionGroup from '@/components/SkTransitionGroup.vue';
|
|
||||||
|
|
||||||
const $i = ensureSignin();
|
const $i = ensureSignin();
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
<MkButton :class="$style.more" :wait="moreFetching" primary rounded @click="fetchMore">{{ i18n.ts.loadMore }}</MkButton>
|
<MkButton :class="$style.more" :wait="moreFetching" primary rounded @click="fetchMore">{{ i18n.ts.loadMore }}</MkButton>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<SkTransitionGroup
|
<MkTransitionGroup
|
||||||
:enterActiveClass="$style.transition_x_enterActive"
|
:enterActiveClass="$style.transition_x_enterActive"
|
||||||
:leaveActiveClass="$style.transition_x_leaveActive"
|
:leaveActiveClass="$style.transition_x_leaveActive"
|
||||||
:enterFromClass="$style.transition_x_enterFrom"
|
:enterFromClass="$style.transition_x_enterFrom"
|
||||||
|
@ -47,7 +47,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
<span>{{ item.prevText }} <i class="ti ti-chevron-down"></i></span>
|
<span>{{ item.prevText }} <i class="ti ti-chevron-down"></i></span>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</SkTransitionGroup>
|
</MkTransitionGroup>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="user && (!user.canChat || user.host !== null)">
|
<div v-if="user && (!user.canChat || user.host !== null)">
|
||||||
|
@ -111,7 +111,6 @@ import { useRouter } from '@/router.js';
|
||||||
import { useMutationObserver } from '@/composables/use-mutation-observer.js';
|
import { useMutationObserver } from '@/composables/use-mutation-observer.js';
|
||||||
import MkInfo from '@/components/MkInfo.vue';
|
import MkInfo from '@/components/MkInfo.vue';
|
||||||
import { makeDateSeparatedTimelineComputedRef } from '@/utility/timeline-date-separate.js';
|
import { makeDateSeparatedTimelineComputedRef } from '@/utility/timeline-date-separate.js';
|
||||||
import SkTransitionGroup from '@/components/SkTransitionGroup.vue';
|
|
||||||
|
|
||||||
const $i = ensureSignin();
|
const $i = ensureSignin();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
|
@ -65,7 +65,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
v-on="popup.events"
|
v-on="popup.events"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<SkTransitionGroup
|
<MkTransitionGroup
|
||||||
tag="div"
|
tag="div"
|
||||||
:class="[$style.notifications, {
|
:class="[$style.notifications, {
|
||||||
[$style.notificationsPosition_leftTop]: prefer.s.notificationPosition === 'leftTop',
|
[$style.notificationsPosition_leftTop]: prefer.s.notificationPosition === 'leftTop',
|
||||||
|
@ -84,7 +84,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
<div v-for="notification in notifications" :key="notification.id" :class="$style.notification">
|
<div v-for="notification in notifications" :key="notification.id" :class="$style.notification">
|
||||||
<XNotification :notification="notification"/>
|
<XNotification :notification="notification"/>
|
||||||
</div>
|
</div>
|
||||||
</SkTransitionGroup>
|
</MkTransitionGroup>
|
||||||
|
|
||||||
<XStreamIndicator/>
|
<XStreamIndicator/>
|
||||||
|
|
||||||
|
@ -110,7 +110,6 @@ import { prefer } from '@/preferences.js';
|
||||||
import { globalEvents } from '@/events.js';
|
import { globalEvents } from '@/events.js';
|
||||||
import { store } from '@/store.js';
|
import { store } from '@/store.js';
|
||||||
import XNavbar from '@/ui/_common_/navbar.vue';
|
import XNavbar from '@/ui/_common_/navbar.vue';
|
||||||
import SkTransitionGroup from '@/components/SkTransitionGroup.vue';
|
|
||||||
|
|
||||||
const XStreamIndicator = defineAsyncComponent(() => import('./stream-indicator.vue'));
|
const XStreamIndicator = defineAsyncComponent(() => import('./stream-indicator.vue'));
|
||||||
const XWidgets = defineAsyncComponent(() => import('./widgets.vue'));
|
const XWidgets = defineAsyncComponent(() => import('./widgets.vue'));
|
||||||
|
|
|
@ -10,7 +10,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
<div class="wbrkwalb">
|
<div class="wbrkwalb">
|
||||||
<MkLoading v-if="fetching"/>
|
<MkLoading v-if="fetching"/>
|
||||||
<SkTransitionGroup v-else tag="div" name="chart" class="instances">
|
<MkTransitionGroup v-else tag="div" name="chart" class="instances">
|
||||||
<div v-for="(instance, i) in instances" :key="instance.id" class="instance">
|
<div v-for="(instance, i) in instances" :key="instance.id" class="instance">
|
||||||
<img :src="getInstanceIcon(instance)" alt=""/>
|
<img :src="getInstanceIcon(instance)" alt=""/>
|
||||||
<div class="body">
|
<div class="body">
|
||||||
|
@ -19,7 +19,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
</div>
|
</div>
|
||||||
<MkMiniChart class="chart" :src="charts[i].requests.received"/>
|
<MkMiniChart class="chart" :src="charts[i].requests.received"/>
|
||||||
</div>
|
</div>
|
||||||
</SkTransitionGroup>
|
</MkTransitionGroup>
|
||||||
</div>
|
</div>
|
||||||
</MkContainer>
|
</MkContainer>
|
||||||
</template>
|
</template>
|
||||||
|
@ -37,7 +37,6 @@ import { misskeyApi, misskeyApiGet } from '@/utility/misskey-api.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import { getProxiedImageUrlNullable } from '@/utility/media-proxy.js';
|
import { getProxiedImageUrlNullable } from '@/utility/media-proxy.js';
|
||||||
import { prefer } from '@/preferences.js';
|
import { prefer } from '@/preferences.js';
|
||||||
import SkTransitionGroup from '@/components/SkTransitionGroup.vue';
|
|
||||||
|
|
||||||
const name = 'federation';
|
const name = 'federation';
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
<div class="wbrkwala">
|
<div class="wbrkwala">
|
||||||
<MkLoading v-if="fetching"/>
|
<MkLoading v-if="fetching"/>
|
||||||
<SkTransitionGroup v-else tag="div" name="chart" class="tags">
|
<MkTransitionGroup v-else tag="div" name="chart" class="tags">
|
||||||
<div v-for="stat in stats" :key="stat.tag">
|
<div v-for="stat in stats" :key="stat.tag">
|
||||||
<div class="tag">
|
<div class="tag">
|
||||||
<MkA class="a" :to="`/tags/${ encodeURIComponent(stat.tag) }`" :title="stat.tag">#{{ stat.tag }}</MkA>
|
<MkA class="a" :to="`/tags/${ encodeURIComponent(stat.tag) }`" :title="stat.tag">#{{ stat.tag }}</MkA>
|
||||||
|
@ -18,7 +18,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
</div>
|
</div>
|
||||||
<MkMiniChart class="chart" :src="stat.chart"/>
|
<MkMiniChart class="chart" :src="stat.chart"/>
|
||||||
</div>
|
</div>
|
||||||
</SkTransitionGroup>
|
</MkTransitionGroup>
|
||||||
</div>
|
</div>
|
||||||
</MkContainer>
|
</MkContainer>
|
||||||
</template>
|
</template>
|
||||||
|
@ -35,7 +35,6 @@ import MkMiniChart from '@/components/MkMiniChart.vue';
|
||||||
import { misskeyApiGet } from '@/utility/misskey-api.js';
|
import { misskeyApiGet } from '@/utility/misskey-api.js';
|
||||||
import { i18n } from '@/i18n.js';
|
import { i18n } from '@/i18n.js';
|
||||||
import { prefer } from '@/preferences.js';
|
import { prefer } from '@/preferences.js';
|
||||||
import SkTransitionGroup from '@/components/SkTransitionGroup.vue';
|
|
||||||
|
|
||||||
const name = 'hashtags';
|
const name = 'hashtags';
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue