From 39b377c06fd15b8402bb2015b347694ac01cda2f Mon Sep 17 00:00:00 2001 From: tamaina Date: Wed, 29 Dec 2021 17:40:39 +0900 Subject: wip --- packages/client/src/scripts/select-file.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'packages/client/src/scripts') diff --git a/packages/client/src/scripts/select-file.ts b/packages/client/src/scripts/select-file.ts index 6019890444..6bb3f8bf8a 100644 --- a/packages/client/src/scripts/select-file.ts +++ b/packages/client/src/scripts/select-file.ts @@ -1,4 +1,5 @@ import * as os from '@/os'; +import { stream } from '@/stream'; import { i18n } from '@/i18n'; import { defaultStore } from '@/store'; import { DriveFile } from 'misskey-js/built/entities'; @@ -48,7 +49,7 @@ function select(src: any, label: string | null, multiple: boolean): Promise { if (data.marker === marker) { res(multiple ? [data.file] : data.file); -- cgit v1.2.3-freya From b3818d9c48ce78f6a5886ade6a378f952bef51c9 Mon Sep 17 00:00:00 2001 From: tamaina Date: Sun, 17 Apr 2022 01:17:11 +0900 Subject: nanka iroiro --- packages/client/src/components/global/a.vue | 25 ++-------- packages/client/src/pages/settings/index.vue | 70 +++++++++++++++------------- packages/client/src/scripts/navigate.ts | 34 ++++++++++++++ 3 files changed, 77 insertions(+), 52 deletions(-) create mode 100644 packages/client/src/scripts/navigate.ts (limited to 'packages/client/src/scripts') diff --git a/packages/client/src/components/global/a.vue b/packages/client/src/components/global/a.vue index 52fef50f9b..5287d59b3e 100644 --- a/packages/client/src/components/global/a.vue +++ b/packages/client/src/components/global/a.vue @@ -5,14 +5,13 @@ diff --git a/packages/client/src/pages/settings/index.vue b/packages/client/src/pages/settings/index.vue index 3786cf60f6..68be795008 100644 --- a/packages/client/src/pages/settings/index.vue +++ b/packages/client/src/pages/settings/index.vue @@ -9,15 +9,15 @@
{{ childInfo.title }}
- @@ -15,10 +27,16 @@ import { notificationTypes } from 'misskey-js'; import FormButton from '@/components/MkButton.vue'; import FormLink from '@/components/form/link.vue'; import FormSection from '@/components/form/section.vue'; +import FormSwitch from '@/components/form/switch.vue'; import * as os from '@/os'; import { $i } from '@/account'; import { i18n } from '@/i18n'; import { definePageMetadata } from '@/scripts/page-metadata'; +import MkPushNotificationAllowButton from '@/components/MkPushNotificationAllowButton.vue'; + +let allowButton = $ref>(); +let pushRegistrationInServer = $computed(() => allowButton?.pushRegistrationInServer); +let sendReadMessage = $computed(() => pushRegistrationInServer?.sendReadMessage || false); async function readAllUnreadNotes() { await os.api('i/read-all-unread-notes'); @@ -49,6 +67,18 @@ function configure() { }, 'closed'); } +function onChangeSendReadMessage(v: boolean) { + if (!pushRegistrationInServer) return; + + os.apiWithDialog('sw/update-registration', { + endpoint: pushRegistrationInServer.endpoint, + sendReadMessage: v, + }).then(res => { + if (!allowButton) return; + allowButton.pushRegistrationInServer = res; + }); +} + const headerActions = $computed(() => []); const headerTabs = $computed(() => []); diff --git a/packages/client/src/pages/timeline.tutorial.vue b/packages/client/src/pages/timeline.tutorial.vue index 7f08ccc2a1..9683cc22a5 100644 --- a/packages/client/src/pages/timeline.tutorial.vue +++ b/packages/client/src/pages/timeline.tutorial.vue @@ -1,6 +1,17 @@
{{ i18n.ts._tutorial.step5_3 }}
- {{ i18n.ts._tutorial.step5_4 }} + {{ i18n.ts._tutorial.step5_4 }}
{{ i18n.ts._tutorial.step6_1 }}
@@ -48,19 +59,20 @@
{{ i18n.ts._tutorial.step7_3 }}
+
+
{{ i18n.ts._tutorial.step8_1 }}
+
{{ i18n.ts._tutorial.step8_2 }}
+ {{ i18n.ts._tutorial.step8_3 }} +
- @@ -68,53 +80,63 @@ - diff --git a/packages/client/src/scripts/initialize-sw.ts b/packages/client/src/scripts/initialize-sw.ts index 7bacfbdf00..de52f30523 100644 --- a/packages/client/src/scripts/initialize-sw.ts +++ b/packages/client/src/scripts/initialize-sw.ts @@ -1,6 +1,3 @@ -import { instance } from '@/instance'; -import { $i } from '@/account'; -import { api } from '@/os'; import { lang } from '@/config'; export async function initializeSw() { @@ -12,57 +9,5 @@ export async function initializeSw() { msg: 'initialize', lang, }); - - if (instance.swPublickey && ('PushManager' in window) && $i && $i.token) { - // SEE: https://developer.mozilla.org/en-US/docs/Web/API/PushManager/subscribe#Parameters - registration.pushManager.subscribe({ - userVisibleOnly: true, - applicationServerKey: urlBase64ToUint8Array(instance.swPublickey) - }) - .then(subscription => { - function encode(buffer: ArrayBuffer | null) { - return btoa(String.fromCharCode.apply(null, new Uint8Array(buffer))); - } - - // Register - api('sw/register', { - endpoint: subscription.endpoint, - auth: encode(subscription.getKey('auth')), - publickey: encode(subscription.getKey('p256dh')) - }); - }) - // When subscribe failed - .catch(async (err: Error) => { - // 通知が許可されていなかったとき - if (err.name === 'NotAllowedError') { - return; - } - - // 違うapplicationServerKey (または gcm_sender_id)のサブスクリプションが - // 既に存在していることが原因でエラーになった可能性があるので、 - // そのサブスクリプションを解除しておく - const subscription = await registration.pushManager.getSubscription(); - if (subscription) subscription.unsubscribe(); - }); - } }); } - -/** - * Convert the URL safe base64 string to a Uint8Array - * @param base64String base64 string - */ -function urlBase64ToUint8Array(base64String: string): Uint8Array { - const padding = '='.repeat((4 - base64String.length % 4) % 4); - const base64 = (base64String + padding) - .replace(/-/g, '+') - .replace(/_/g, '/'); - - const rawData = window.atob(base64); - const outputArray = new Uint8Array(rawData.length); - - for (let i = 0; i < rawData.length; ++i) { - outputArray[i] = rawData.charCodeAt(i); - } - return outputArray; -} -- cgit v1.2.3-freya From bb3d274db64fe662ad01780ca5eadbc263f6f759 Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Sun, 18 Dec 2022 13:13:05 +0900 Subject: refactor(client): add proper types to `never[]` (#9340) --- packages/client/src/components/mfm.ts | 9 +++--- packages/client/src/scripts/array.ts | 2 +- packages/client/src/scripts/collect-page-vars.ts | 38 ++++++++++++++++------ packages/client/src/scripts/physics.ts | 16 ++++----- packages/client/src/store.ts | 41 ++++++++++++++++++++---- 5 files changed, 78 insertions(+), 28 deletions(-) (limited to 'packages/client/src/scripts') diff --git a/packages/client/src/components/mfm.ts b/packages/client/src/components/mfm.ts index 688857a499..5b5b1caae3 100644 --- a/packages/client/src/components/mfm.ts +++ b/packages/client/src/components/mfm.ts @@ -54,13 +54,13 @@ export default defineComponent({ return t.match(/^[0-9.]+s$/) ? t : null; }; - const genEl = (ast: mfm.MfmNode[]) => concat(ast.map((token): VNode[] => { + const genEl = (ast: mfm.MfmNode[]) => ast.map((token): VNode | string | (VNode | string)[] => { switch (token.type) { case 'text': { const text = token.props.text.replace(/(\r\n|\n|\r)/g, '\n'); if (!this.plain) { - const res = []; + const res: (VNode | string)[] = []; for (const t of text.split('\n')) { res.push(h('br')); res.push(t); @@ -317,12 +317,13 @@ export default defineComponent({ } default: { - console.error('unrecognized ast type:', token.type); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + console.error('unrecognized ast type:', (token as any).type); return []; } } - })); + }).flat(Infinity) as (VNode | string)[]; // Parse ast to DOM return h('span', genEl(ast)); diff --git a/packages/client/src/scripts/array.ts b/packages/client/src/scripts/array.ts index 26c6195d66..4620c8b735 100644 --- a/packages/client/src/scripts/array.ts +++ b/packages/client/src/scripts/array.ts @@ -123,7 +123,7 @@ export function lessThan(xs: number[], ys: number[]): boolean { * Returns the longest prefix of elements that satisfy the predicate */ export function takeWhile(f: Predicate, xs: T[]): T[] { - const ys = []; + const ys: T[] = []; for (const x of xs) { if (f(x)) { ys.push(x); diff --git a/packages/client/src/scripts/collect-page-vars.ts b/packages/client/src/scripts/collect-page-vars.ts index a4096fb2c2..76b68beaf6 100644 --- a/packages/client/src/scripts/collect-page-vars.ts +++ b/packages/client/src/scripts/collect-page-vars.ts @@ -1,42 +1,62 @@ -export function collectPageVars(content) { - const pageVars = []; - const collect = (xs: any[]) => { +interface StringPageVar { + name: string, + type: 'string', + value: string +} + +interface NumberPageVar { + name: string, + type: 'number', + value: number +} + +interface BooleanPageVar { + name: string, + type: 'boolean', + value: boolean +} + +type PageVar = StringPageVar | NumberPageVar | BooleanPageVar; + +export function collectPageVars(content): PageVar[] { + const pageVars: PageVar[] = []; + const collect = (xs: any[]): void => { for (const x of xs) { if (x.type === 'textInput') { pageVars.push({ name: x.name, type: 'string', - value: x.default || '' + value: x.default || '', }); } else if (x.type === 'textareaInput') { pageVars.push({ name: x.name, type: 'string', - value: x.default || '' + value: x.default || '', }); } else if (x.type === 'numberInput') { pageVars.push({ name: x.name, type: 'number', - value: x.default || 0 + value: x.default || 0, }); } else if (x.type === 'switch') { pageVars.push({ name: x.name, type: 'boolean', - value: x.default || false + value: x.default || false, }); } else if (x.type === 'counter') { pageVars.push({ name: x.name, type: 'number', - value: 0 + value: 0, }); } else if (x.type === 'radioButton') { pageVars.push({ name: x.name, type: 'string', - value: x.default || '' + value: x.default || '', }); } else if (x.children) { collect(x.children); diff --git a/packages/client/src/scripts/physics.ts b/packages/client/src/scripts/physics.ts index 9e657906c2..f0a5b0fdd6 100644 --- a/packages/client/src/scripts/physics.ts +++ b/packages/client/src/scripts/physics.ts @@ -55,13 +55,13 @@ export function physics(container: HTMLElement) { //wallLeft, ]); - const objEls = Array.from(container.children); - const objs = []; + const objEls = Array.from(container.children) as HTMLElement[]; + const objs: Matter.Body[] = []; for (const objEl of objEls) { const left = objEl.dataset.physicsX ? parseInt(objEl.dataset.physicsX) : objEl.offsetLeft; const top = objEl.dataset.physicsY ? parseInt(objEl.dataset.physicsY) : objEl.offsetTop; - let obj; + let obj: Matter.Body; if (objEl.classList.contains('_physics_circle_')) { obj = Matter.Bodies.circle( left + (objEl.offsetWidth / 2), @@ -84,7 +84,7 @@ export function physics(container: HTMLElement) { } ); } - objEl.id = obj.id; + objEl.id = obj.id.toString(); objs.push(obj); } @@ -109,10 +109,10 @@ export function physics(container: HTMLElement) { render.mouse = mouse; for (const objEl of objEls) { - objEl.style.position = `absolute`; - objEl.style.top = 0; - objEl.style.left = 0; - objEl.style.margin = 0; + objEl.style.position = 'absolute'; + objEl.style.top = '0'; + objEl.style.left = '0'; + objEl.style.margin = '0'; } window.requestAnimationFrame(update); diff --git a/packages/client/src/store.ts b/packages/client/src/store.ts index 3971214af0..061e1913d6 100644 --- a/packages/client/src/store.ts +++ b/packages/client/src/store.ts @@ -2,11 +2,34 @@ import { markRaw, ref } from 'vue'; import { Storage } from './pizzax'; import { Theme } from './scripts/theme'; -export const postFormActions = []; -export const userActions = []; -export const noteActions = []; -export const noteViewInterruptors = []; -export const notePostInterruptors = []; +interface PostFormAction { + title: string, + handler: (form: T, update: (key: unknown, value: unknown) => void) => void; +} + +interface UserAction { + title: string, + handler: (user: UserDetailed) => void; +} + +interface NoteAction { + title: string, + handler: (note: Note) => void; +} + +interface NoteViewInterruptor { + handler: (note: Note) => unknown; +} + +interface NotePostInterruptor { + handler: (note: FIXME) => unknown; +} + +export const postFormActions: PostFormAction[] = []; +export const userActions: UserAction[] = []; +export const noteActions: NoteAction[] = []; +export const noteViewInterruptors: NoteViewInterruptor[] = []; +export const notePostInterruptors: NotePostInterruptor[] = []; // TODO: それぞれいちいちwhereとかdefaultというキーを付けなきゃいけないの冗長なのでなんとかする(ただ型定義が面倒になりそう) // あと、現行の定義の仕方なら「whereが何であるかに関わらずキー名の重複不可」という制約を付けられるメリットもあるからそのメリットを引き継ぐ方法も考えないといけない @@ -266,11 +289,17 @@ type Plugin = { ast: any[]; }; +interface Watcher { + key: string; + callback: (value: unknown) => void; +} + /** * 常にメモリにロードしておく必要がないような設定情報を保管するストレージ(非リアクティブ) */ import lightTheme from '@/themes/l-light.json5'; import darkTheme from '@/themes/d-green-lime.json5'; +import { Note, UserDetailed } from 'misskey-js/built/entities'; export class ColdDeviceStorage { public static default = { @@ -289,7 +318,7 @@ export class ColdDeviceStorage { sound_channel: { type: 'syuilo/square-pico', volume: 1 }, }; - public static watchers = []; + public static watchers: Watcher[] = []; public static get(key: T): typeof ColdDeviceStorage.default[T] { // TODO: indexedDBにする -- cgit v1.2.3-freya From a47d172d60b1ae712738e0ba5dfbb6b81be3f809 Mon Sep 17 00:00:00 2001 From: Kagami Sascha Rosylight Date: Sun, 18 Dec 2022 15:40:38 +0900 Subject: enhance(client): Compress non-animated PNG files (#9334) * style: fix TS lint errors about `ev.target` * enhance: compress non-animated PNG * PNG to PNG? * defer jest things (add it later) * Delete jest.config.cjs * check the compressed file size * log compression stats * use ?? * handle if ($i == null) Co-authored-by: tamaina --- packages/client/package.json | 1 + packages/client/src/scripts/upload.ts | 47 +++++++++++----------- .../client/src/scripts/upload/compress-config.ts | 23 +++++++++++ yarn.lock | 8 ++++ 4 files changed, 55 insertions(+), 24 deletions(-) create mode 100644 packages/client/src/scripts/upload/compress-config.ts (limited to 'packages/client/src/scripts') diff --git a/packages/client/package.json b/packages/client/package.json index 9f86a471b0..2c9b3cbb21 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -31,6 +31,7 @@ "eventemitter3": "5.0.0", "idb-keyval": "6.2.0", "insert-text-at-cursor": "0.3.0", + "is-file-animated": "1.0.1", "json5": "2.2.1", "katex": "0.15.6", "matter-js": "0.18.0", diff --git a/packages/client/src/scripts/upload.ts b/packages/client/src/scripts/upload.ts index 51f1c1b86f..9a39652ef5 100644 --- a/packages/client/src/scripts/upload.ts +++ b/packages/client/src/scripts/upload.ts @@ -1,6 +1,7 @@ import { reactive, ref } from 'vue'; import * as Misskey from 'misskey-js'; import { readAndCompressImage } from 'browser-image-resizer'; +import { getCompressionConfig } from './upload/compress-config'; import { defaultStore } from '@/store'; import { apiUrl } from '@/config'; import { $i } from '@/account'; @@ -16,12 +17,6 @@ type Uploading = { }; export const uploads = ref([]); -const compressTypeMap = { - 'image/jpeg': { quality: 0.85, mimeType: 'image/jpeg' }, - 'image/webp': { quality: 0.85, mimeType: 'image/jpeg' }, - 'image/svg+xml': { quality: 1, mimeType: 'image/png' }, -} as const; - const mimeTypeMap = { 'image/webp': 'webp', 'image/jpeg': 'jpg', @@ -34,16 +29,18 @@ export function uploadFile( name?: string, keepOriginal: boolean = defaultStore.state.keepOriginalUploading, ): Promise { + if ($i == null) throw new Error('Not logged in'); + if (folder && typeof folder === 'object') folder = folder.id; return new Promise((resolve, reject) => { const id = Math.random().toString(); const reader = new FileReader(); - reader.onload = async (ev) => { + reader.onload = async (): Promise => { const ctx = reactive({ id: id, - name: name || file.name || 'untitled', + name: name ?? file.name ?? 'untitled', progressMax: undefined, progressValue: undefined, img: window.URL.createObjectURL(file), @@ -51,20 +48,22 @@ export function uploadFile( uploads.value.push(ctx); - let resizedImage: any; - if (!keepOriginal && file.type in compressTypeMap) { - const imgConfig = compressTypeMap[file.type]; - - const config = { - maxWidth: 2048, - maxHeight: 2048, - debug: true, - ...imgConfig, - }; - + const config = !keepOriginal ? await getCompressionConfig(file) : undefined; + let resizedImage: Blob | undefined; + if (config) { try { - resizedImage = await readAndCompressImage(file, config); - ctx.name = file.type !== imgConfig.mimeType ? `${ctx.name}.${mimeTypeMap[compressTypeMap[file.type].mimeType]}` : ctx.name; + const resized = await readAndCompressImage(file, config); + if (resized.size < file.size || file.type === 'image/webp') { + // The compression may not always reduce the file size + // (and WebP is not browser safe yet) + resizedImage = resized; + } + if (_DEV_) { + const saved = ((1 - resized.size / file.size) * 100).toFixed(2); + console.log(`Image compression: before ${file.size} bytes, after ${resized.size} bytes, saved ${saved}%`); + } + + ctx.name = file.type !== config.mimeType ? `${ctx.name}.${mimeTypeMap[config.mimeType]}` : ctx.name; } catch (err) { console.error('Failed to resize image', err); } @@ -73,13 +72,13 @@ export function uploadFile( const formData = new FormData(); formData.append('i', $i.token); formData.append('force', 'true'); - formData.append('file', resizedImage || file); + formData.append('file', resizedImage ?? file); formData.append('name', ctx.name); if (folder) formData.append('folderId', folder); const xhr = new XMLHttpRequest(); xhr.open('POST', apiUrl + '/drive/files/create', true); - xhr.onload = (ev) => { + xhr.onload = ((ev: ProgressEvent) => { if (xhr.status !== 200 || ev.target == null || ev.target.response == null) { // TODO: 消すのではなくて(ネットワーク的なエラーなら)再送できるようにしたい uploads.value = uploads.value.filter(x => x.id !== id); @@ -122,7 +121,7 @@ export function uploadFile( resolve(driveFile); uploads.value = uploads.value.filter(x => x.id !== id); - }; + }) as (ev: ProgressEvent) => any; xhr.upload.onprogress = ev => { if (ev.lengthComputable) { diff --git a/packages/client/src/scripts/upload/compress-config.ts b/packages/client/src/scripts/upload/compress-config.ts new file mode 100644 index 0000000000..793c78ad20 --- /dev/null +++ b/packages/client/src/scripts/upload/compress-config.ts @@ -0,0 +1,23 @@ +import isAnimated from 'is-file-animated'; +import type { BrowserImageResizerConfig } from 'browser-image-resizer'; + +const compressTypeMap = { + 'image/jpeg': { quality: 0.85, mimeType: 'image/jpeg' }, + 'image/png': { quality: 1, mimeType: 'image/png' }, + 'image/webp': { quality: 0.85, mimeType: 'image/jpeg' }, + 'image/svg+xml': { quality: 1, mimeType: 'image/png' }, +} as const; + +export async function getCompressionConfig(file: File): Promise { + const imgConfig = compressTypeMap[file.type]; + if (!imgConfig || await isAnimated(file)) { + return; + } + + return { + maxWidth: 2048, + maxHeight: 2048, + debug: true, + ...imgConfig, + }; +} diff --git a/yarn.lock b/yarn.lock index dc9ac7ccd8..96db703b28 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4975,6 +4975,7 @@ __metadata: eventemitter3: 5.0.0 idb-keyval: 6.2.0 insert-text-at-cursor: 0.3.0 + is-file-animated: 1.0.1 json5: 2.2.1 katex: 0.15.6 matter-js: 0.18.0 @@ -9574,6 +9575,13 @@ __metadata: languageName: node linkType: hard +"is-file-animated@npm:1.0.1": + version: 1.0.1 + resolution: "is-file-animated@npm:1.0.1" + checksum: bcc281e0694e1ba74adfdef75f83f1637ab6470eceecef867d21b4a98e112c32188514b3172348dd137b82cbe8771b6d683de1439d8e1e86011fed77da896c4e + languageName: node + linkType: hard + "is-fullwidth-code-point@npm:^1.0.0": version: 1.0.0 resolution: "is-fullwidth-code-point@npm:1.0.0" -- cgit v1.2.3-freya From f83bd31fd5fee0bb2209ad0e5359ffa473ffb30e Mon Sep 17 00:00:00 2001 From: syuilo Date: Mon, 19 Dec 2022 13:53:41 +0900 Subject: wip --- packages/backend/src/server/web/views/base.pug | 2 +- packages/client/src/account.ts | 2 +- .../client/src/components/MkAbuseReportWindow.vue | 2 +- .../src/components/MkChannelFollowButton.vue | 4 ++-- packages/client/src/components/MkDialog.vue | 2 +- packages/client/src/components/MkDrive.file.vue | 4 ++-- packages/client/src/components/MkDrive.folder.vue | 2 +- .../client/src/components/MkDrive.navFolder.vue | 2 +- packages/client/src/components/MkDrive.vue | 6 ++--- packages/client/src/components/MkEmojiPicker.vue | 2 +- packages/client/src/components/MkFollowButton.vue | 6 ++--- packages/client/src/components/MkGoogle.vue | 2 +- .../client/src/components/MkModalPageWindow.vue | 6 ++--- packages/client/src/components/MkModalWindow.vue | 2 +- packages/client/src/components/MkNote.vue | 18 +++++++------- packages/client/src/components/MkNoteDetailed.vue | 18 +++++++------- packages/client/src/components/MkNotification.vue | 8 +++---- packages/client/src/components/MkPageWindow.vue | 6 ++--- packages/client/src/components/MkPoll.vue | 2 +- packages/client/src/components/MkPostForm.vue | 10 ++++---- packages/client/src/components/MkRenoteButton.vue | 4 ++-- packages/client/src/components/MkSignup.vue | 10 ++++---- .../client/src/components/MkSubNoteContent.vue | 2 +- packages/client/src/components/MkVisibility.vue | 2 +- .../client/src/components/MkVisibilityPicker.vue | 4 ++-- packages/client/src/components/MkWaitingDialog.vue | 2 +- packages/client/src/components/MkWidgets.vue | 6 ++--- packages/client/src/components/form/checkbox.vue | 2 +- packages/client/src/components/form/input.vue | 2 +- packages/client/src/components/form/link.vue | 2 +- packages/client/src/components/global/MkA.vue | 4 ++-- packages/client/src/components/page/page.post.vue | 4 ++-- packages/client/src/navbar.ts | 14 +++++------ packages/client/src/pages/about-misskey.vue | 2 +- packages/client/src/pages/about.emojis.vue | 2 +- packages/client/src/pages/about.federation.vue | 2 +- packages/client/src/pages/about.vue | 2 +- packages/client/src/pages/admin-file.vue | 4 ++-- packages/client/src/pages/admin/abuses.vue | 2 +- packages/client/src/pages/admin/ads.vue | 4 ++-- packages/client/src/pages/admin/announcements.vue | 4 ++-- packages/client/src/pages/admin/email-settings.vue | 2 +- .../client/src/pages/admin/emoji-edit-dialog.vue | 2 +- packages/client/src/pages/admin/emojis.vue | 10 ++++---- packages/client/src/pages/admin/files.vue | 6 ++--- packages/client/src/pages/admin/index.vue | 24 +++++++++---------- packages/client/src/pages/admin/integrations.vue | 2 +- packages/client/src/pages/admin/object-storage.vue | 4 ++-- packages/client/src/pages/admin/other-settings.vue | 4 ++-- packages/client/src/pages/admin/relays.vue | 8 +++---- packages/client/src/pages/admin/security.vue | 2 +- packages/client/src/pages/admin/settings.vue | 12 +++++----- packages/client/src/pages/admin/users.vue | 6 ++--- packages/client/src/pages/announcements.vue | 2 +- packages/client/src/pages/antenna-timeline.vue | 2 +- packages/client/src/pages/api-console.vue | 2 +- packages/client/src/pages/channel-editor.vue | 4 ++-- packages/client/src/pages/channel.vue | 2 +- packages/client/src/pages/channels.vue | 4 ++-- packages/client/src/pages/clip.vue | 4 ++-- packages/client/src/pages/drive.vue | 2 +- packages/client/src/pages/emojis.emoji.vue | 2 +- packages/client/src/pages/explore.users.vue | 6 ++--- packages/client/src/pages/explore.vue | 4 ++-- packages/client/src/pages/favorites.vue | 2 +- packages/client/src/pages/follow-requests.vue | 2 +- packages/client/src/pages/gallery/edit.vue | 4 ++-- packages/client/src/pages/gallery/index.vue | 4 ++-- packages/client/src/pages/gallery/post.vue | 4 ++-- packages/client/src/pages/instance-info.vue | 2 +- packages/client/src/pages/messaging/index.vue | 4 ++-- .../src/pages/messaging/messaging-room.form.vue | 2 +- packages/client/src/pages/my-antennas/index.vue | 2 +- packages/client/src/pages/my-clips/index.vue | 6 ++--- packages/client/src/pages/my-lists/index.vue | 4 ++-- packages/client/src/pages/notifications.vue | 4 ++-- .../pages/page-editor/els/page-editor.el.if.vue | 2 +- .../pages/page-editor/els/page-editor.el.post.vue | 2 +- .../page-editor/els/page-editor.el.section.vue | 2 +- .../pages/page-editor/page-editor.container.vue | 2 +- .../client/src/pages/page-editor/page-editor.vue | 14 +++++------ packages/client/src/pages/page.vue | 4 ++-- packages/client/src/pages/pages.vue | 4 ++-- packages/client/src/pages/registry.keys.vue | 2 +- packages/client/src/pages/registry.value.vue | 2 +- packages/client/src/pages/registry.vue | 2 +- packages/client/src/pages/search.vue | 2 +- packages/client/src/pages/settings/accounts.vue | 4 ++-- packages/client/src/pages/settings/apps.vue | 2 +- packages/client/src/pages/settings/drive.vue | 2 +- packages/client/src/pages/settings/email.vue | 2 +- packages/client/src/pages/settings/general.vue | 2 +- packages/client/src/pages/settings/index.vue | 12 +++++----- packages/client/src/pages/settings/integration.vue | 2 +- .../client/src/pages/settings/notifications.vue | 4 ++-- packages/client/src/pages/settings/other.vue | 4 ++-- .../client/src/pages/settings/plugin.install.vue | 2 +- packages/client/src/pages/settings/plugin.vue | 4 ++-- packages/client/src/pages/settings/profile.vue | 4 ++-- packages/client/src/pages/settings/reaction.vue | 2 +- packages/client/src/pages/settings/security.vue | 2 +- .../client/src/pages/settings/theme.install.vue | 2 +- .../client/src/pages/settings/theme.manage.vue | 2 +- packages/client/src/pages/settings/theme.vue | 2 +- .../client/src/pages/settings/webhook.edit.vue | 2 +- packages/client/src/pages/settings/webhook.new.vue | 2 +- packages/client/src/pages/settings/webhook.vue | 2 +- packages/client/src/pages/share.vue | 2 +- packages/client/src/pages/tag.vue | 2 +- packages/client/src/pages/theme-editor.vue | 2 +- packages/client/src/pages/timeline.tutorial.vue | 2 +- packages/client/src/pages/timeline.vue | 10 ++++---- packages/client/src/pages/user-list-timeline.vue | 2 +- packages/client/src/pages/user/home.vue | 2 +- packages/client/src/pages/user/index.activity.vue | 2 +- packages/client/src/pages/user/index.vue | 4 ++-- packages/client/src/pages/welcome.entrance.a.vue | 2 +- packages/client/src/pages/welcome.entrance.c.vue | 2 +- packages/client/src/pages/welcome.timeline.vue | 2 +- packages/client/src/scripts/get-note-menu.ts | 28 +++++++++++----------- packages/client/src/scripts/get-user-menu.ts | 4 ++-- packages/client/src/scripts/hpml/lib.ts | 6 ++--- packages/client/src/scripts/select-file.ts | 4 ++-- packages/client/src/style.scss | 5 ++++ .../client/src/ui/_common_/navbar-for-mobile.vue | 6 ++--- packages/client/src/ui/_common_/navbar.vue | 6 ++--- packages/client/src/ui/classic.header.vue | 6 ++--- packages/client/src/ui/classic.sidebar.vue | 6 ++--- packages/client/src/ui/classic.widgets.vue | 2 +- packages/client/src/ui/deck.vue | 10 ++++---- packages/client/src/ui/deck/column.vue | 4 ++-- .../client/src/ui/deck/notifications-column.vue | 2 +- packages/client/src/ui/deck/tl-column.vue | 10 ++++---- packages/client/src/ui/universal.vue | 4 ++-- packages/client/src/ui/universal.widgets.vue | 2 +- packages/client/src/ui/visitor/b.vue | 4 ++-- packages/client/src/ui/visitor/header.vue | 6 ++--- packages/client/src/widgets/federation.vue | 2 +- packages/client/src/widgets/notifications.vue | 4 ++-- packages/client/src/widgets/rss-ticker.vue | 2 +- packages/client/src/widgets/rss.vue | 2 +- packages/client/src/widgets/timeline.vue | 16 ++++++------- packages/client/src/widgets/trends.vue | 2 +- 143 files changed, 311 insertions(+), 306 deletions(-) (limited to 'packages/client/src/scripts') diff --git a/packages/backend/src/server/web/views/base.pug b/packages/backend/src/server/web/views/base.pug index 7d802d37ce..472defa102 100644 --- a/packages/backend/src/server/web/views/base.pug +++ b/packages/backend/src/server/web/views/base.pug @@ -34,7 +34,7 @@ html link(rel='prefetch' href='https://xn--931a.moe/assets/info.jpg') link(rel='prefetch' href='https://xn--931a.moe/assets/not-found.jpg') link(rel='prefetch' href='https://xn--931a.moe/assets/error.jpg') - link(rel='stylesheet' href='/assets/fontawesome/css/all.css') + link(rel='stylesheet' href='https://unpkg.com/@tabler/icons@1.117.0/iconfont/tabler-icons.min.css') link(rel='modulepreload' href=`/assets/${clientEntry.file}`) if Array.isArray(clientEntry.css) diff --git a/packages/client/src/account.ts b/packages/client/src/account.ts index e9c29d6b0d..e981536dd8 100644 --- a/packages/client/src/account.ts +++ b/packages/client/src/account.ts @@ -213,7 +213,7 @@ export async function openAccountMenu(opts: { avatar: $i, }, null, ...(opts.includeCurrentAccount ? [createItem($i)] : []), ...accountItemPromises, { type: 'parent', - icon: 'fas fa-plus', + icon: 'ti ti-plus', text: i18n.ts.addAccount, children: [{ text: i18n.ts.existingAccount, diff --git a/packages/client/src/components/MkAbuseReportWindow.vue b/packages/client/src/components/MkAbuseReportWindow.vue index 1862d0a0e4..03890b4e97 100644 --- a/packages/client/src/components/MkAbuseReportWindow.vue +++ b/packages/client/src/components/MkAbuseReportWindow.vue @@ -1,7 +1,7 @@ diff --git a/packages/client/src/pages/settings/webhook.new.vue b/packages/client/src/pages/settings/webhook.new.vue index fcf1329ff6..b42f283945 100644 --- a/packages/client/src/pages/settings/webhook.new.vue +++ b/packages/client/src/pages/settings/webhook.new.vue @@ -26,7 +26,7 @@
- {{ i18n.ts.create }} + {{ i18n.ts.create }}
diff --git a/packages/client/src/pages/settings/webhook.vue b/packages/client/src/pages/settings/webhook.vue index 1a7e73940c..d3ad475cd8 100644 --- a/packages/client/src/pages/settings/webhook.vue +++ b/packages/client/src/pages/settings/webhook.vue @@ -13,7 +13,7 @@ {{ webhook.name || webhook.url }} diff --git a/packages/client/src/pages/share.vue b/packages/client/src/pages/share.vue index 69d22ed632..a7e797eeab 100644 --- a/packages/client/src/pages/share.vue +++ b/packages/client/src/pages/share.vue @@ -158,7 +158,7 @@ const headerTabs = $computed(() => []); definePageMetadata({ title: i18n.ts.share, - icon: 'fas fa-share-alt', + icon: 'ti ti-share', }); diff --git a/packages/client/src/pages/tag.vue b/packages/client/src/pages/tag.vue index 5498c2999d..72775ed5c9 100644 --- a/packages/client/src/pages/tag.vue +++ b/packages/client/src/pages/tag.vue @@ -30,6 +30,6 @@ const headerTabs = $computed(() => []); definePageMetadata(computed(() => ({ title: props.tag, - icon: 'fas fa-hashtag', + icon: 'ti ti-hash', }))); diff --git a/packages/client/src/pages/theme-editor.vue b/packages/client/src/pages/theme-editor.vue index 7dfeee16ed..f0435427eb 100644 --- a/packages/client/src/pages/theme-editor.vue +++ b/packages/client/src/pages/theme-editor.vue @@ -215,7 +215,7 @@ const headerActions = $computed(() => [{ handler: showPreview, }, { asFullButton: true, - icon: 'fas fa-check', + icon: 'ti ti-check', text: i18n.ts.saveAs, handler: saveAs, }]); diff --git a/packages/client/src/pages/timeline.tutorial.vue b/packages/client/src/pages/timeline.tutorial.vue index 9683cc22a5..b1a1af1383 100644 --- a/packages/client/src/pages/timeline.tutorial.vue +++ b/packages/client/src/pages/timeline.tutorial.vue @@ -71,7 +71,7 @@ {{ i18n.ts.noThankYou }} diff --git a/packages/client/src/pages/timeline.vue b/packages/client/src/pages/timeline.vue index 9d42997025..8c2dc92ccd 100644 --- a/packages/client/src/pages/timeline.vue +++ b/packages/client/src/pages/timeline.vue @@ -114,22 +114,22 @@ const headerActions = $computed(() => []); const headerTabs = $computed(() => [{ key: 'home', title: i18n.ts._timelines.home, - icon: 'fas fa-home', + icon: 'ti ti-home-2', iconOnly: true, }, ...(isLocalTimelineAvailable ? [{ key: 'local', title: i18n.ts._timelines.local, - icon: 'fas fa-comments', + icon: 'ti ti-messages', iconOnly: true, }, { key: 'social', title: i18n.ts._timelines.social, - icon: 'fas fa-share-alt', + icon: 'ti ti-share', iconOnly: true, }] : []), ...(isGlobalTimelineAvailable ? [{ key: 'global', title: i18n.ts._timelines.global, - icon: 'fas fa-globe', + icon: 'ti ti-world', iconOnly: true, }] : []), { icon: 'fas fa-list-ul', @@ -150,7 +150,7 @@ const headerTabs = $computed(() => [{ definePageMetadata(computed(() => ({ title: i18n.ts.timeline, - icon: src === 'local' ? 'fas fa-comments' : src === 'social' ? 'fas fa-share-alt' : src === 'global' ? 'fas fa-globe' : 'fas fa-home', + icon: src === 'local' ? 'ti ti-messages' : src === 'social' ? 'ti ti-share' : src === 'global' ? 'ti ti-world' : 'ti ti-home-2', }))); diff --git a/packages/client/src/pages/user-list-timeline.vue b/packages/client/src/pages/user-list-timeline.vue index 4a534e47ba..773b20d80c 100644 --- a/packages/client/src/pages/user-list-timeline.vue +++ b/packages/client/src/pages/user-list-timeline.vue @@ -69,7 +69,7 @@ const headerActions = $computed(() => list ? [{ text: i18n.ts.jumpToSpecifiedDate, handler: timetravel, }, { - icon: 'fas fa-cog', + icon: 'ti ti-settings', text: i18n.ts.settings, handler: settings, }] : []); diff --git a/packages/client/src/pages/user/home.vue b/packages/client/src/pages/user/home.vue index 352db4616e..98c7e9d116 100644 --- a/packages/client/src/pages/user/home.vue +++ b/packages/client/src/pages/user/home.vue @@ -25,7 +25,7 @@ {{ i18n.ts.followsYou }}
- +
diff --git a/packages/client/src/pages/user/index.activity.vue b/packages/client/src/pages/user/index.activity.vue index 630a2cea7d..7f25176e82 100644 --- a/packages/client/src/pages/user/index.activity.vue +++ b/packages/client/src/pages/user/index.activity.vue @@ -3,7 +3,7 @@ diff --git a/packages/client/src/pages/user/index.vue b/packages/client/src/pages/user/index.vue index 7e635f8b2e..21f1d25dfd 100644 --- a/packages/client/src/pages/user/index.vue +++ b/packages/client/src/pages/user/index.vue @@ -69,7 +69,7 @@ const headerActions = $computed(() => []); const headerTabs = $computed(() => user ? [{ key: 'home', title: i18n.ts.overview, - icon: 'fas fa-home', + icon: 'ti ti-home-2', }, ...($i && ($i.id === user.id)) || user.publicReactions ? [{ key: 'reactions', title: i18n.ts.reaction, @@ -77,7 +77,7 @@ const headerTabs = $computed(() => user ? [{ }] : [], { key: 'clips', title: i18n.ts.clips, - icon: 'fas fa-paperclip', + icon: 'ti ti-paperclip', }, { key: 'pages', title: i18n.ts.pages, diff --git a/packages/client/src/pages/welcome.entrance.a.vue b/packages/client/src/pages/welcome.entrance.a.vue index 827162a0c0..119ba96ec9 100644 --- a/packages/client/src/pages/welcome.entrance.a.vue +++ b/packages/client/src/pages/welcome.entrance.a.vue @@ -15,7 +15,7 @@
- +

diff --git a/packages/client/src/pages/welcome.entrance.c.vue b/packages/client/src/pages/welcome.entrance.c.vue index a590834a4c..535580e723 100644 --- a/packages/client/src/pages/welcome.entrance.c.vue +++ b/packages/client/src/pages/welcome.entrance.c.vue @@ -41,7 +41,7 @@

- +