Merge branch 'develop' into pr/ThatOneCalculator/8764

This commit is contained in:
tamaina 2022-11-13 18:48:18 +09:00
commit 7c406ea97f
22 changed files with 107 additions and 17781 deletions

View file

@ -14,11 +14,11 @@
"@rollup/pluginutils": "5.0.2",
"@syuilo/aiscript": "0.11.1",
"@vitejs/plugin-vue": "3.2.0",
"@vue/compiler-sfc": "3.2.41",
"@vue/compiler-sfc": "3.2.45",
"autobind-decorator": "2.4.0",
"autosize": "5.0.1",
"blurhash": "1.1.5",
"broadcast-channel": "4.18.0",
"broadcast-channel": "4.18.1",
"browser-image-resizer": "git+https://github.com/misskey-dev/browser-image-resizer#v2.2.1-misskey.3",
"chart.js": "3.9.1",
"chartjs-adapter-date-fns": "2.0.0",
@ -42,7 +42,7 @@
"querystring": "0.2.1",
"rndstr": "1.0.0",
"s-age": "1.1.2",
"sass": "1.55.0",
"sass": "1.56.1",
"seedrandom": "3.0.5",
"strict-event-emitter-types": "2.0.0",
"stringz": "2.1.0",
@ -51,14 +51,14 @@
"three": "0.146.0",
"throttle-debounce": "5.0.0",
"tinycolor2": "1.4.2",
"tsc-alias": "1.7.0",
"tsc-alias": "1.7.1",
"tsconfig-paths": "4.1.0",
"twemoji-parser": "14.0.0",
"typescript": "4.8.4",
"uuid": "9.0.0",
"vanilla-tilt": "1.7.2",
"vite": "3.2.0",
"vue": "3.2.41",
"vanilla-tilt": "1.7.3",
"vite": "3.2.3",
"vue": "3.2.45",
"vue-prism-editor": "2.0.0-alpha.2",
"vuedraggable": "4.0.1"
},
@ -76,14 +76,14 @@
"@types/uuid": "8.3.4",
"@types/websocket": "1.0.5",
"@types/ws": "8.5.3",
"@typescript-eslint/eslint-plugin": "5.41.0",
"@typescript-eslint/parser": "5.41.0",
"@typescript-eslint/eslint-plugin": "5.42.1",
"@typescript-eslint/parser": "5.42.1",
"cross-env": "7.0.3",
"cypress": "10.11.0",
"eslint": "8.26.0",
"cypress": "11.0.1",
"eslint": "8.27.0",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-vue": "9.6.0",
"rollup": "3.2.3",
"eslint-plugin-vue": "9.7.0",
"rollup": "3.3.0",
"start-server-and-test": "1.14.0"
}
}

View file

@ -34,9 +34,9 @@ import XModalWindow from '@/components/MkModalWindow.vue';
import * as os from '@/os';
import { $i } from '@/account';
import { defaultStore } from '@/store';
import { apiUrl, url } from '@/config';
import { query } from '@/scripts/url';
import { apiUrl } from '@/config';
import { i18n } from '@/i18n';
import { getProxiedImageUrl } from '@/scripts/media-proxy';
const emit = defineEmits<{
(ev: 'ok', cropped: misskey.entities.DriveFile): void;
@ -49,9 +49,7 @@ const props = defineProps<{
aspectRatio: number;
}>();
const imgUrl = `${url}/proxy/image.webp?${query({
url: props.file.url,
})}`;
const imgUrl = getProxiedImageUrl(props.file.url);
let dialogEl = $ref<InstanceType<typeof XModalWindow>>();
let imgEl = $ref<HTMLImageElement>();
let cropper: Cropper | null = null;
@ -72,10 +70,10 @@ const ok = async () => {
method: 'POST',
body: formData,
})
.then(response => response.json())
.then(f => {
res(f);
});
.then(response => response.json())
.then(f => {
res(f);
});
});
});

View file

@ -9,6 +9,7 @@
import { } from 'vue';
import { instanceName } from '@/config';
import { instance as Instance } from '@/instance';
import { getProxiedImageUrlNullable } from '@/scripts/media-proxy';
const props = defineProps<{
instance?: {
@ -20,15 +21,15 @@ const props = defineProps<{
// if no instance data is given, this is for the local instance
const instance = props.instance ?? {
faviconUrl: Instance.iconUrl || Instance.faviconUrl || '/favicon.ico',
faviconUrl: getProxiedImageUrlNullable(Instance.iconUrl) ?? getProxiedImageUrlNullable(Instance.faviconUrl) ?? '/favicon.ico',
name: instanceName,
themeColor: (document.querySelector('meta[name="theme-color-orig"]') as HTMLMetaElement)?.content
themeColor: (document.querySelector('meta[name="theme-color-orig"]') as HTMLMetaElement).content,
};
const themeColor = instance.themeColor ?? '#777777';
const bg = {
background: `linear-gradient(90deg, ${themeColor}, ${themeColor}00)`
background: `linear-gradient(90deg, ${themeColor}, ${themeColor}00)`,
};
</script>

View file

@ -82,16 +82,6 @@ import { getAccountFromId } from '@/scripts/get-account-from-id';
else location.reload();
});
//#region SEE: https://css-tricks.com/the-trick-to-viewport-units-on-mobile/
// TODO: いつの日にか消したい
const vh = window.innerHeight * 0.01;
document.documentElement.style.setProperty('--vh', `${vh}px`);
window.addEventListener('resize', () => {
const vh = window.innerHeight * 0.01;
document.documentElement.style.setProperty('--vh', `${vh}px`);
});
//#endregion
// If mobile, insert the viewport meta tag
if (['smartphone', 'tablet'].includes(deviceKind)) {
const viewport = document.getElementsByName('viewport').item(0);

View file

@ -8,6 +8,7 @@ import * as os from '@/os';
import copyToClipboard from '@/scripts/copy-to-clipboard';
import { url } from '@/config';
import { noteActions } from '@/store';
import { notePage } from '@/filters/note';
export function getNoteMenu(props: {
note: misskey.entities.Note;
@ -172,7 +173,9 @@ export function getNoteMenu(props: {
url: `${url}/notes/${appearNote.id}`,
});
}
function notedetails(): void {
os.pageWindow(`/notes/${appearNote.id}`);
}
async function translate(): Promise<void> {
if (props.translation.value != null) return;
props.translating.value = true;
@ -198,8 +201,11 @@ export function getNoteMenu(props: {
danger: true,
action: unclip,
}, null] : []
),
{
), {
icon: 'fas fa-external-link-alt',
text: i18n.ts.details,
action: notedetails,
}, {
icon: 'fas fa-copy',
text: i18n.ts.copyContent,
action: copyContent,
@ -300,6 +306,10 @@ export function getNoteMenu(props: {
.filter(x => x !== undefined);
} else {
menu = [{
icon: 'fas fa-external-link-alt',
text: i18n.ts.detailed,
action: openDetail,
}, {
icon: 'fas fa-copy',
text: i18n.ts.copyContent,
action: copyContent,

View file

@ -0,0 +1,13 @@
import { query } from '@/scripts/url';
import { url } from '@/config';
export function getProxiedImageUrl(imageUrl: string): string {
return `${url}/proxy/image.webp?${query({
url: imageUrl,
})}`;
}
export function getProxiedImageUrlNullable(imageUrl: string | null | undefined): string | null {
if (imageUrl == null) return null;
return getProxiedImageUrl(imageUrl);
}

View file

@ -168,8 +168,7 @@ function more(ev: MouseEvent) {
left: 0;
z-index: 1001;
width: $nav-icon-only-width;
// 100vh ... https://css-tricks.com/the-trick-to-viewport-units-on-mobile/
height: calc(var(--vh, 1vh) * 100);
height: 100dvh;
box-sizing: border-box;
overflow: auto;
overflow-x: clip;

View file

@ -198,8 +198,7 @@ onMounted(() => {
$ui-font-size: 1em;
$widgets-hide-threshold: 1200px;
// 100vh ... https://css-tricks.com/the-trick-to-viewport-units-on-mobile/
min-height: calc(var(--vh, 1vh) * 100);
min-height: 100dvh;
box-sizing: border-box;
&.wallpaper {
@ -301,8 +300,7 @@ onMounted(() => {
top: 0;
right: 0;
z-index: 1001;
// 100vh ... https://css-tricks.com/the-trick-to-viewport-units-on-mobile/
height: calc(var(--vh, 1vh) * 100);
height: 100dvh;
padding: var(--margin);
box-sizing: border-box;
overflow: auto;

View file

@ -255,8 +255,7 @@ async function deleteProfile() {
--deckDividerThickness: 5px;
display: flex;
// 100vh ... https://css-tricks.com/the-trick-to-viewport-units-on-mobile/
height: calc(var(--vh, 1vh) * 100);
height: 100dvh;
box-sizing: border-box;
flex: 1;
@ -424,8 +423,7 @@ async function deleteProfile() {
top: 0;
left: 0;
z-index: 1001;
// 100vh ... https://css-tricks.com/the-trick-to-viewport-units-on-mobile/
height: calc(var(--vh, 1vh) * 100);
height: 100dvh;
width: 240px;
box-sizing: border-box;
contain: strict;

View file

@ -220,8 +220,7 @@ const wallpaper = localStorage.getItem('wallpaper') != null;
$ui-font-size: 1em; // TODO:
$widgets-hide-threshold: 1090px;
// 100vh ... https://css-tricks.com/the-trick-to-viewport-units-on-mobile/
min-height: calc(var(--vh, 1vh) * 100);
min-height: 100dvh;
box-sizing: border-box;
display: flex;
@ -273,8 +272,7 @@ const wallpaper = localStorage.getItem('wallpaper') != null;
top: 0;
right: 0;
z-index: 1001;
// 100vh ... https://css-tricks.com/the-trick-to-viewport-units-on-mobile/
height: calc(var(--vh, 1vh) * 100);
height: 100dvh;
padding: var(--margin);
box-sizing: border-box;
overflow: auto;
@ -362,8 +360,7 @@ const wallpaper = localStorage.getItem('wallpaper') != null;
top: 0;
left: 0;
z-index: 1001;
// 100vh ... https://css-tricks.com/the-trick-to-viewport-units-on-mobile/
height: calc(var(--vh, 1vh) * 100);
height: 100dvh;
width: 240px;
box-sizing: border-box;
contain: strict;

View file

@ -28,8 +28,7 @@ document.documentElement.style.overflowY = 'scroll';
<style lang="scss" scoped>
.mk-app {
// 100vh ... https://css-tricks.com/the-trick-to-viewport-units-on-mobile/
min-height: calc(var(--vh, 1vh) * 100);
min-height: 100dvh;
box-sizing: border-box;
}
</style>