merge: upstream

This commit is contained in:
Mar0xy 2023-10-31 19:33:24 +01:00
commit 4dd23a3793
No known key found for this signature in database
GPG key ID: 56569BBE47D2C828
217 changed files with 6773 additions and 2275 deletions

View file

@ -3,12 +3,42 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/
import type { MenuItem } from '@/types/menu.js';
import * as os from '@/os.js';
import { instance } from '@/instance.js';
import { host } from '@/config.js';
import { i18n } from '@/i18n.js';
import { $i } from '@/account.js';
function toolsMenuItems(): MenuItem[] {
return [{
type: 'link',
to: '/scratchpad',
text: i18n.ts.scratchpad,
icon: 'ph-terminal-window ph-bold ph-lg-2',
}, {
type: 'link',
to: '/api-console',
text: 'API Console',
icon: 'ph-terminal-window ph-bold ph-lg-2',
}, {
type: 'link',
to: '/clicker',
text: '🍪👈',
icon: 'ph-cookie ph-bold pg-lg',
}, ($i && ($i.isAdmin || $i.policies.canManageCustomEmojis)) ? {
type: 'link',
to: '/custom-emojis-manager',
text: i18n.ts.manageCustomEmojis,
icon: 'ph-smiley ph-bold pg-lg',
} : undefined, ($i && ($i.isAdmin || $i.policies.canManageAvatarDecorations)) ? {
type: 'link',
to: '/avatar-decorations',
text: i18n.ts.manageAvatarDecorations,
icon: 'ph-sparkle ph-bold pg-lg',
} : undefined];
}
export function openInstanceMenu(ev: MouseEvent) {
os.popupMenu([{
text: instance.name ?? host,
@ -46,28 +76,8 @@ export function openInstanceMenu(ev: MouseEvent) {
} : undefined, {
type: 'parent',
text: i18n.ts.tools,
icon: 'ph-wrench ph-bold ph-lg',
children: [{
type: 'link',
to: '/scratchpad',
text: i18n.ts.scratchpad,
icon: 'ph-terminal-window ph-bold ph-lg-2',
}, {
type: 'link',
to: '/api-console',
text: 'API Console',
icon: 'ph-terminal-window ph-bold ph-lg-2',
}, {
type: 'link',
to: '/clicker',
text: '🍪👈',
icon: 'ph-cookie ph-bold pg-lg',
}, ($i && ($i.isAdmin || $i.policies.canManageCustomEmojis)) ? {
type: 'link',
to: '/custom-emojis-manager',
text: i18n.ts.manageCustomEmojis,
icon: 'ph-smiley ph-bold pg-lg',
} : undefined],
icon: 'ph-toolbox ph-bold ph-lg',
children: toolsMenuItems(),
}, null, (instance.impressumUrl) ? {
text: i18n.ts.impressum,
icon: 'ph-newspaper-clipping ph-bold pg-lg',
@ -100,3 +110,9 @@ export function openInstanceMenu(ev: MouseEvent) {
align: 'left',
});
}
export function openToolsMenu(ev: MouseEvent) {
os.popupMenu(toolsMenuItems(), ev.currentTarget ?? ev.target, {
align: 'left',
});
}

View file

@ -58,9 +58,9 @@ SPDX-License-Identifier: AGPL-3.0-only
<script lang="ts" setup>
import { computed, defineAsyncComponent, ref, watch } from 'vue';
import { openInstanceMenu } from './common';
import { openInstanceMenu } from './common.js';
import * as os from '@/os.js';
import { navbarItemDef } from '@/navbar';
import { navbarItemDef } from '@/navbar.js';
import { $i, openAccountMenu as openAccountMenu_ } from '@/account.js';
import { defaultStore } from '@/store.js';
import { i18n } from '@/i18n.js';
@ -230,6 +230,7 @@ function more(ev: MouseEvent) {
text-align: left;
box-sizing: border-box;
margin-top: 16px;
overflow: clip;
}
.avatar {
@ -401,6 +402,7 @@ function more(ev: MouseEvent) {
display: block;
text-align: center;
width: 100%;
overflow: clip;
}
.avatar {

View file

@ -15,7 +15,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<script lang="ts" setup>
import { onUnmounted } from 'vue';
import { useStream } from '@/stream.js';
import { useStream, isReloading } from '@/stream.js';
import { i18n } from '@/i18n.js';
import MkButton from '@/components/MkButton.vue';
import * as os from '@/os.js';
@ -26,6 +26,7 @@ const zIndex = os.claimZIndex('high');
let hasDisconnected = $ref(false);
function onDisconnected() {
if (isReloading) return;
hasDisconnected = true;
}

View file

@ -319,7 +319,7 @@ $widgets-hide-threshold: 1090px;
min-width: 0;
overflow: auto;
overflow-y: scroll;
overscroll-behavior: contain;
overscroll-behavior: none;
background: var(--bg);
}