chore: 🚨 lint client
This commit is contained in:
parent
2e922c0a69
commit
0fb65a91e9
44 changed files with 102 additions and 107 deletions
|
@ -1,10 +1,10 @@
|
||||||
|
import type * as misskey from "firefish-js";
|
||||||
|
import { defineAsyncComponent, reactive } from "vue";
|
||||||
|
import { i18n } from "./i18n";
|
||||||
import { apiUrl } from "@/config";
|
import { apiUrl } from "@/config";
|
||||||
import { alert, api, popup, popupMenu, success, waiting } from "@/os";
|
import { alert, api, popup, popupMenu, success, waiting } from "@/os";
|
||||||
import { del, get, set } from "@/scripts/idb-proxy";
|
import { del, get, set } from "@/scripts/idb-proxy";
|
||||||
import { reloadChannel, unisonReload } from "@/scripts/unison-reload";
|
import { reloadChannel, unisonReload } from "@/scripts/unison-reload";
|
||||||
import type * as misskey from "firefish-js";
|
|
||||||
import { defineAsyncComponent, reactive } from "vue";
|
|
||||||
import { i18n } from "./i18n";
|
|
||||||
|
|
||||||
// TODO: 他のタブと永続化されたstateを同期
|
// TODO: 他のタブと永続化されたstateを同期
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
import * as mfm from "mfm-js";
|
||||||
|
import { defineComponent, h } from "vue";
|
||||||
|
import type { VNode } from "vue";
|
||||||
import MkCode from "@/components/MkCode.vue";
|
import MkCode from "@/components/MkCode.vue";
|
||||||
import MkFormula from "@/components/MkFormula.vue";
|
import MkFormula from "@/components/MkFormula.vue";
|
||||||
import MkGoogle from "@/components/MkGoogle.vue";
|
import MkGoogle from "@/components/MkGoogle.vue";
|
||||||
|
@ -11,9 +14,6 @@ import { host } from "@/config";
|
||||||
import { concat } from "@/scripts/array";
|
import { concat } from "@/scripts/array";
|
||||||
import { reducedMotion } from "@/scripts/reduced-motion";
|
import { reducedMotion } from "@/scripts/reduced-motion";
|
||||||
import { defaultStore } from "@/store";
|
import { defaultStore } from "@/store";
|
||||||
import * as mfm from "mfm-js";
|
|
||||||
import { defineComponent, h } from "vue";
|
|
||||||
import type { VNode } from "vue";
|
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
props: {
|
props: {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { getScrollContainer, getScrollPosition } from "@/scripts/scroll";
|
|
||||||
import type { Directive } from "vue";
|
import type { Directive } from "vue";
|
||||||
|
import { getScrollContainer, getScrollPosition } from "@/scripts/scroll";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mounted(src, binding, vn) {
|
mounted(src, binding, vn) {
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
// TODO: useTooltip関数使うようにしたい
|
// TODO: useTooltip関数使うようにしたい
|
||||||
// ただディレクティブ内でonUnmountedなどのcomposition api使えるのか不明
|
// ただディレクティブ内でonUnmountedなどのcomposition api使えるのか不明
|
||||||
|
|
||||||
|
import type { Directive } from "vue";
|
||||||
|
import { defineAsyncComponent, ref } from "vue";
|
||||||
import { alert, popup } from "@/os";
|
import { alert, popup } from "@/os";
|
||||||
import { mainRouter } from "@/router";
|
import { mainRouter } from "@/router";
|
||||||
import { isTouchUsing } from "@/scripts/touch";
|
import { isTouchUsing } from "@/scripts/touch";
|
||||||
import type { Directive } from "vue";
|
|
||||||
import { defineAsyncComponent, ref } from "vue";
|
|
||||||
|
|
||||||
const start = isTouchUsing ? "touchstart" : "mouseover";
|
const start = isTouchUsing ? "touchstart" : "mouseover";
|
||||||
const end = isTouchUsing ? "touchend" : "mouseleave";
|
const end = isTouchUsing ? "touchend" : "mouseleave";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { popup } from "@/os";
|
|
||||||
import type { Directive } from "vue";
|
import type { Directive } from "vue";
|
||||||
import { defineAsyncComponent, ref } from "vue";
|
import { defineAsyncComponent, ref } from "vue";
|
||||||
|
import { popup } from "@/os";
|
||||||
|
|
||||||
export class UserPreview {
|
export class UserPreview {
|
||||||
private el;
|
private el;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { url } from "@/config";
|
|
||||||
import type * as misskey from "firefish-js";
|
import type * as misskey from "firefish-js";
|
||||||
import * as Acct from "firefish-js/built/acct";
|
import * as Acct from "firefish-js/built/acct";
|
||||||
|
import { url } from "@/config";
|
||||||
|
|
||||||
export const acct = (user: misskey.Acct) => {
|
export const acct = (user: misskey.Acct) => {
|
||||||
return Acct.toString(user);
|
return Acct.toString(user);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
import { markRaw } from "vue";
|
||||||
import { locale } from "@/config";
|
import { locale } from "@/config";
|
||||||
import { I18n } from "@/scripts/i18n";
|
import { I18n } from "@/scripts/i18n";
|
||||||
import { markRaw } from "vue";
|
|
||||||
|
|
||||||
export const i18n = markRaw(new I18n(locale));
|
export const i18n = markRaw(new I18n(locale));
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
|
import { computed, reactive, ref } from "vue";
|
||||||
|
import { $i } from "./account";
|
||||||
import { ui } from "@/config";
|
import { ui } from "@/config";
|
||||||
import { i18n } from "@/i18n";
|
import { i18n } from "@/i18n";
|
||||||
import * as os from "@/os";
|
import * as os from "@/os";
|
||||||
import { search } from "@/scripts/search";
|
import { search } from "@/scripts/search";
|
||||||
import { unisonReload } from "@/scripts/unison-reload";
|
import { unisonReload } from "@/scripts/unison-reload";
|
||||||
import { computed, reactive, ref } from "vue";
|
|
||||||
import { $i } from "./account";
|
|
||||||
|
|
||||||
export const navbarItemDef = reactive({
|
export const navbarItemDef = reactive({
|
||||||
notifications: {
|
notifications: {
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
// NIRAX --- A lightweight router
|
// NIRAX --- A lightweight router
|
||||||
|
|
||||||
import { pleaseLogin } from "@/scripts/please-login";
|
|
||||||
import { safeURIDecode } from "@/scripts/safe-uri-decode";
|
|
||||||
import { EventEmitter } from "eventemitter3";
|
import { EventEmitter } from "eventemitter3";
|
||||||
import type { Component, ShallowRef } from "vue";
|
import type { Component, ShallowRef } from "vue";
|
||||||
import { Ref, ref, shallowRef } from "vue";
|
import { Ref, ref, shallowRef } from "vue";
|
||||||
|
import { safeURIDecode } from "@/scripts/safe-uri-decode";
|
||||||
|
import { pleaseLogin } from "@/scripts/please-login";
|
||||||
|
|
||||||
interface RouteDef {
|
interface RouteDef {
|
||||||
path: string;
|
path: string;
|
||||||
|
@ -93,8 +93,8 @@ export class Router extends EventEmitter<{
|
||||||
}
|
}
|
||||||
|
|
||||||
public resolve(path: string): Resolved | null {
|
public resolve(path: string): Resolved | null {
|
||||||
let queryString: string | null = null;
|
let queryString: string | null = null,
|
||||||
let hash: string | null = null;
|
hash: string | null = null;
|
||||||
if (path[0] === "/") path = path.substring(1);
|
if (path[0] === "/") path = path.substring(1);
|
||||||
if (path.includes("#")) {
|
if (path.includes("#")) {
|
||||||
hash = path.substring(path.indexOf("#") + 1);
|
hash = path.substring(path.indexOf("#") + 1);
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
// TODO: なんでもかんでもos.tsに突っ込むのやめたいのでよしなに分割する
|
// TODO: なんでもかんでもos.tsに突っ込むのやめたいのでよしなに分割する
|
||||||
|
|
||||||
import { $i } from "@/account";
|
|
||||||
import MkDialog from "@/components/MkDialog.vue";
|
|
||||||
import MkPostFormDialog from "@/components/MkPostFormDialog.vue";
|
|
||||||
import MkToast from "@/components/MkToast.vue";
|
|
||||||
import MkWaitingDialog from "@/components/MkWaitingDialog.vue";
|
|
||||||
import { url, apiUrl } from "@/config";
|
|
||||||
import type { MenuItem } from "@/types/menu";
|
|
||||||
import { EventEmitter } from "eventemitter3";
|
import { EventEmitter } from "eventemitter3";
|
||||||
import * as Misskey from "firefish-js";
|
import * as Misskey from "firefish-js";
|
||||||
import insertTextAtCursor from "insert-text-at-cursor";
|
import insertTextAtCursor from "insert-text-at-cursor";
|
||||||
import type { Component, Ref } from "vue";
|
import type { Component, Ref } from "vue";
|
||||||
import { defineAsyncComponent, markRaw, ref } from "vue";
|
import { defineAsyncComponent, markRaw, ref } from "vue";
|
||||||
import { i18n } from "./i18n";
|
import { i18n } from "./i18n";
|
||||||
|
import { $i } from "@/account";
|
||||||
|
import MkDialog from "@/components/MkDialog.vue";
|
||||||
|
import MkPostFormDialog from "@/components/MkPostFormDialog.vue";
|
||||||
|
import MkToast from "@/components/MkToast.vue";
|
||||||
|
import MkWaitingDialog from "@/components/MkWaitingDialog.vue";
|
||||||
|
import { apiUrl, url } from "@/config";
|
||||||
|
import type { MenuItem } from "@/types/menu";
|
||||||
|
|
||||||
export const pendingApiRequestsCount = ref(0);
|
export const pendingApiRequestsCount = ref(0);
|
||||||
|
|
||||||
|
@ -772,8 +772,8 @@ type AwaitType<T> = T extends Promise<infer U>
|
||||||
: T extends (...args: any[]) => Promise<infer V>
|
: T extends (...args: any[]) => Promise<infer V>
|
||||||
? V
|
? V
|
||||||
: T;
|
: T;
|
||||||
let openingEmojiPicker: AwaitType<ReturnType<typeof popup>> | null = null;
|
let openingEmojiPicker: AwaitType<ReturnType<typeof popup>> | null = null,
|
||||||
let activeTextarea: HTMLTextAreaElement | HTMLInputElement | null = null;
|
activeTextarea: HTMLTextAreaElement | HTMLInputElement | null = null;
|
||||||
export async function openEmojiPicker(
|
export async function openEmojiPicker(
|
||||||
src: HTMLElement,
|
src: HTMLElement,
|
||||||
opts,
|
opts,
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
import { AiScript, utils, values } from "@syuilo/aiscript";
|
||||||
|
import { jsToVal } from "@syuilo/aiscript/built/interpreter/util";
|
||||||
|
import { deserialize } from "@syuilo/aiscript/built/serializer";
|
||||||
import { inputText } from "@/os";
|
import { inputText } from "@/os";
|
||||||
import { createAiScriptEnv } from "@/scripts/aiscript/api";
|
import { createAiScriptEnv } from "@/scripts/aiscript/api";
|
||||||
import {
|
import {
|
||||||
|
@ -7,9 +10,6 @@ import {
|
||||||
postFormActions,
|
postFormActions,
|
||||||
userActions,
|
userActions,
|
||||||
} from "@/store";
|
} from "@/store";
|
||||||
import { AiScript, utils, values } from "@syuilo/aiscript";
|
|
||||||
import { jsToVal } from "@syuilo/aiscript/built/interpreter/util";
|
|
||||||
import { deserialize } from "@syuilo/aiscript/built/serializer";
|
|
||||||
|
|
||||||
const pluginContexts = new Map<string, AiScript>();
|
const pluginContexts = new Map<string, AiScript>();
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
|
import type { AsyncComponentLoader } from "vue";
|
||||||
|
import { defineAsyncComponent, inject } from "vue";
|
||||||
import { $i, iAmModerator } from "@/account";
|
import { $i, iAmModerator } from "@/account";
|
||||||
import { ui } from "@/config";
|
import { ui } from "@/config";
|
||||||
import { Router } from "@/nirax";
|
import { Router } from "@/nirax";
|
||||||
import { api } from "@/os";
|
import { api } from "@/os";
|
||||||
import MkError from "@/pages/_error_.vue";
|
import MkError from "@/pages/_error_.vue";
|
||||||
import MkLoading from "@/pages/_loading_.vue";
|
import MkLoading from "@/pages/_loading_.vue";
|
||||||
import type { AsyncComponentLoader } from "vue";
|
|
||||||
import { defineAsyncComponent, inject } from "vue";
|
|
||||||
|
|
||||||
function getGuestTimelineStatus() {
|
function getGuestTimelineStatus() {
|
||||||
api("meta", {
|
api("meta", {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
import { utils, values } from "@syuilo/aiscript";
|
||||||
import { $i } from "@/account";
|
import { $i } from "@/account";
|
||||||
import * as os from "@/os";
|
import * as os from "@/os";
|
||||||
import { utils, values } from "@syuilo/aiscript";
|
|
||||||
|
|
||||||
export function createAiScriptEnv(opts) {
|
export function createAiScriptEnv(opts) {
|
||||||
let apiRequests = 0;
|
let apiRequests = 0;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { popup } from "@/os";
|
|
||||||
import { toASCII } from "punycode/";
|
import { toASCII } from "punycode/";
|
||||||
import getCaretCoordinates from "textarea-caret";
|
import getCaretCoordinates from "textarea-caret";
|
||||||
import type { Ref } from "vue";
|
import type { Ref } from "vue";
|
||||||
import { defineAsyncComponent, nextTick, ref } from "vue";
|
import { defineAsyncComponent, nextTick, ref } from "vue";
|
||||||
|
import { popup } from "@/os";
|
||||||
|
|
||||||
export class Autocomplete {
|
export class Autocomplete {
|
||||||
private suggestion: {
|
private suggestion: {
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { defaultStore } from "@/store";
|
|
||||||
import keywordSet from "emojilib";
|
import keywordSet from "emojilib";
|
||||||
import individualData from "unicode-emoji-json/data-by-emoji.json";
|
import individualData from "unicode-emoji-json/data-by-emoji.json";
|
||||||
import data from "unicode-emoji-json/data-by-group.json";
|
import data from "unicode-emoji-json/data-by-group.json";
|
||||||
import emojiComponents from "unicode-emoji-json/data-emoji-components.json";
|
import emojiComponents from "unicode-emoji-json/data-emoji-components.json";
|
||||||
|
import { defaultStore } from "@/store";
|
||||||
|
|
||||||
export interface UnicodeEmojiDef {
|
export interface UnicodeEmojiDef {
|
||||||
emoji: string;
|
emoji: string;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { unique } from "@/scripts/array";
|
|
||||||
import * as mfm from "mfm-js";
|
import * as mfm from "mfm-js";
|
||||||
|
import { unique } from "@/scripts/array";
|
||||||
|
|
||||||
// unique without hash
|
// unique without hash
|
||||||
// [ http://a/#1, http://a/#2, http://b/#3 ] => [ http://a/#1, http://b/#3 ]
|
// [ http://a/#1, http://a/#2, http://b/#3 ] => [ http://a/#1, http://b/#3 ]
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
import { host as localHost } from "@/config";
|
|
||||||
import * as Acct from "firefish-js/built/acct";
|
import * as Acct from "firefish-js/built/acct";
|
||||||
|
import { host as localHost } from "@/config";
|
||||||
|
|
||||||
export async function genSearchQuery(v: any, q: string) {
|
export async function genSearchQuery(v: any, q: string) {
|
||||||
let host: string;
|
let host: string, userId: string;
|
||||||
let userId: string;
|
|
||||||
if (q.split(" ").some((x) => x.startsWith("@"))) {
|
if (q.split(" ").some((x) => x.startsWith("@"))) {
|
||||||
for (const at of q
|
for (const at of q
|
||||||
.split(" ")
|
.split(" ")
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
import type * as misskey from "firefish-js";
|
||||||
|
import type { Ref } from "vue";
|
||||||
|
import { defineAsyncComponent, inject } from "vue";
|
||||||
import { $i } from "@/account";
|
import { $i } from "@/account";
|
||||||
import { url } from "@/config";
|
import { url } from "@/config";
|
||||||
import { i18n } from "@/i18n";
|
import { i18n } from "@/i18n";
|
||||||
|
@ -7,9 +10,6 @@ import copyToClipboard from "@/scripts/copy-to-clipboard";
|
||||||
import { getUserMenu } from "@/scripts/get-user-menu";
|
import { getUserMenu } from "@/scripts/get-user-menu";
|
||||||
import { shareAvailable } from "@/scripts/share-available";
|
import { shareAvailable } from "@/scripts/share-available";
|
||||||
import { noteActions } from "@/store";
|
import { noteActions } from "@/store";
|
||||||
import type * as misskey from "firefish-js";
|
|
||||||
import type { Ref } from "vue";
|
|
||||||
import { defineAsyncComponent, inject } from "vue";
|
|
||||||
|
|
||||||
export function getNoteMenu(props: {
|
export function getNoteMenu(props: {
|
||||||
note: misskey.entities.Note;
|
note: misskey.entities.Note;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { i18n } from "@/i18n";
|
|
||||||
import type * as misskey from "firefish-js";
|
import type * as misskey from "firefish-js";
|
||||||
|
import { i18n } from "@/i18n";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 投稿を表す文字列を取得します。
|
* 投稿を表す文字列を取得します。
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import * as Acct from "firefish-js/built/acct";
|
||||||
|
import { defineAsyncComponent } from "vue";
|
||||||
import { $i, iAmModerator } from "@/account";
|
import { $i, iAmModerator } from "@/account";
|
||||||
import { host } from "@/config";
|
import { host } from "@/config";
|
||||||
import { i18n } from "@/i18n";
|
import { i18n } from "@/i18n";
|
||||||
|
@ -6,8 +8,6 @@ import * as os from "@/os";
|
||||||
import { mainRouter } from "@/router";
|
import { mainRouter } from "@/router";
|
||||||
import copyToClipboard from "@/scripts/copy-to-clipboard";
|
import copyToClipboard from "@/scripts/copy-to-clipboard";
|
||||||
import { userActions } from "@/store";
|
import { userActions } from "@/store";
|
||||||
import * as Acct from "firefish-js/built/acct";
|
|
||||||
import { defineAsyncComponent } from "vue";
|
|
||||||
|
|
||||||
export function getUserMenu(user, router: Router = mainRouter) {
|
export function getUserMenu(user, router: Router = mainRouter) {
|
||||||
const meId = $i ? $i.id : null;
|
const meId = $i ? $i.id : null;
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
|
import XTutorial from "../components/MkTutorialDialog.vue";
|
||||||
import { host } from "@/config";
|
import { host } from "@/config";
|
||||||
import { i18n } from "@/i18n";
|
import { i18n } from "@/i18n";
|
||||||
import { instance } from "@/instance";
|
import { instance } from "@/instance";
|
||||||
import * as os from "@/os";
|
import * as os from "@/os";
|
||||||
import { defaultStore } from "@/store";
|
import { defaultStore } from "@/store";
|
||||||
import XTutorial from "../components/MkTutorialDialog.vue";
|
|
||||||
|
|
||||||
export function openHelpMenu_(ev: MouseEvent) {
|
export function openHelpMenu_(ev: MouseEvent) {
|
||||||
os.popupMenu(
|
os.popupMenu(
|
||||||
|
|
|
@ -1,16 +1,16 @@
|
||||||
import { version } from "@/config";
|
|
||||||
import * as os from "@/os";
|
|
||||||
import { AiScript, utils, values } from "@syuilo/aiscript";
|
import { AiScript, utils, values } from "@syuilo/aiscript";
|
||||||
import autobind from "autobind-decorator";
|
import autobind from "autobind-decorator";
|
||||||
import type { Ref } from "vue";
|
import type { Ref } from "vue";
|
||||||
import { markRaw, ref, unref } from "vue";
|
import { markRaw, ref, unref } from "vue";
|
||||||
import { HpmlError, HpmlScope } from ".";
|
|
||||||
import type { Fn, PageVar, envVarsDef } from ".";
|
|
||||||
import { createAiScriptEnv } from "../aiscript/api";
|
import { createAiScriptEnv } from "../aiscript/api";
|
||||||
import { collectPageVars } from "../collect-page-vars";
|
import { collectPageVars } from "../collect-page-vars";
|
||||||
import type { Expr, Variable } from "./expr";
|
import type { Expr, Variable } from "./expr";
|
||||||
import { isLiteralValue } from "./expr";
|
import { isLiteralValue } from "./expr";
|
||||||
import { initAiLib, initHpmlLib } from "./lib";
|
import { initAiLib, initHpmlLib } from "./lib";
|
||||||
|
import type { Fn, PageVar, envVarsDef } from ".";
|
||||||
|
import { HpmlError, HpmlScope } from ".";
|
||||||
|
import * as os from "@/os";
|
||||||
|
import { version } from "@/config";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Hpml evaluator
|
* Hpml evaluator
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import { utils, values } from "@syuilo/aiscript";
|
import { utils, values } from "@syuilo/aiscript";
|
||||||
import seedrandom from "seedrandom";
|
import seedrandom from "seedrandom";
|
||||||
import tinycolor from "tinycolor2";
|
import tinycolor from "tinycolor2";
|
||||||
import type { Fn, HpmlScope } from ".";
|
|
||||||
import type { Hpml } from "./evaluator";
|
import type { Hpml } from "./evaluator";
|
||||||
import type { Expr } from "./expr";
|
import type { Expr } from "./expr";
|
||||||
|
import type { Fn, HpmlScope } from ".";
|
||||||
|
|
||||||
/* TODO: https://www.chartjs.org/docs/latest/configuration/canvas-background.html#color
|
/* TODO: https://www.chartjs.org/docs/latest/configuration/canvas-background.html#color
|
||||||
// https://stackoverflow.com/questions/38493564/chart-area-background-color-chartjs
|
// https://stackoverflow.com/questions/38493564/chart-area-background-color-chartjs
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import autobind from "autobind-decorator";
|
import autobind from "autobind-decorator";
|
||||||
import { envVarsDef } from ".";
|
|
||||||
import type { PageVar, Type } from ".";
|
|
||||||
import type { Expr, Variable } from "./expr";
|
import type { Expr, Variable } from "./expr";
|
||||||
import { isLiteralValue } from "./expr";
|
import { isLiteralValue } from "./expr";
|
||||||
import { funcDefs } from "./lib";
|
import { funcDefs } from "./lib";
|
||||||
|
import type { PageVar, Type } from ".";
|
||||||
|
import { envVarsDef } from ".";
|
||||||
|
|
||||||
interface TypeError {
|
interface TypeError {
|
||||||
arg: number;
|
arg: number;
|
||||||
|
|
|
@ -61,8 +61,8 @@ function parseSingleKaTeXMacro(src: string): [string, KaTeXMacro] {
|
||||||
currentPos = skipSpaces(currentPos);
|
currentPos = skipSpaces(currentPos);
|
||||||
|
|
||||||
while (currentPos < src.length - 1) {
|
while (currentPos < src.length - 1) {
|
||||||
let numbersignPos = -1;
|
let numbersignPos = -1,
|
||||||
let isEscaped = false;
|
isEscaped = false;
|
||||||
|
|
||||||
for (let i = currentPos; i < src.length - 1; ++i) {
|
for (let i = currentPos; i < src.length - 1; ++i) {
|
||||||
if (src[i] !== "\\" && src[i] !== "#") {
|
if (src[i] !== "\\" && src[i] !== "#") {
|
||||||
|
@ -210,15 +210,15 @@ function expandKaTeXMacroOnce(
|
||||||
--maxNumberOfExpansions;
|
--maxNumberOfExpansions;
|
||||||
|
|
||||||
// search for a custom macro
|
// search for a custom macro
|
||||||
let checkedPos = beginPos - 1;
|
let checkedPos = beginPos - 1,
|
||||||
let macroName = "";
|
macroName = "",
|
||||||
let macroBackslashPos = 0;
|
macroBackslashPos = 0,
|
||||||
// for macros w/o args: unused
|
// for macros w/o args: unused
|
||||||
// w/ args: the first open bracket ("(", "{", or "[") after cmd name
|
// w/ args: the first open bracket ("(", "{", or "[") after cmd name
|
||||||
let macroArgBeginPos = 0;
|
macroArgBeginPos = 0,
|
||||||
// for macros w/o args: the end of cmd name
|
// for macros w/o args: the end of cmd name
|
||||||
// w/ args: the closing bracket of the last arg
|
// w/ args: the closing bracket of the last arg
|
||||||
let macroArgEndPos = 0;
|
macroArgEndPos = 0;
|
||||||
|
|
||||||
while (checkedPos < endPos) {
|
while (checkedPos < endPos) {
|
||||||
checkedPos = src.indexOf("\\", checkedPos + 1);
|
checkedPos = src.indexOf("\\", checkedPos + 1);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
import * as Acct from "firefish-js/built/acct";
|
||||||
import { i18n } from "@/i18n";
|
import { i18n } from "@/i18n";
|
||||||
import * as os from "@/os";
|
import * as os from "@/os";
|
||||||
import * as Acct from "firefish-js/built/acct";
|
|
||||||
|
|
||||||
export async function lookupUser() {
|
export async function lookupUser() {
|
||||||
const { canceled, result } = await os.inputText({
|
const { canceled, result } = await os.inputText({
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
|
import { defineAsyncComponent } from "vue";
|
||||||
import { $i } from "@/account";
|
import { $i } from "@/account";
|
||||||
import { i18n } from "@/i18n";
|
import { i18n } from "@/i18n";
|
||||||
import { popup } from "@/os";
|
import { popup } from "@/os";
|
||||||
import { defineAsyncComponent } from "vue";
|
|
||||||
|
|
||||||
export function pleaseLogin(path?: string) {
|
export function pleaseLogin(path?: string) {
|
||||||
if ($i) return;
|
if ($i) return;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import * as config from "@/config";
|
|
||||||
import { appendQuery } from "./url";
|
import { appendQuery } from "./url";
|
||||||
|
import * as config from "@/config";
|
||||||
|
|
||||||
export function popout(path: string, w?: HTMLElement) {
|
export function popout(path: string, w?: HTMLElement) {
|
||||||
let url =
|
let url =
|
||||||
|
|
|
@ -22,8 +22,7 @@ export function calcPopupPosition(
|
||||||
}
|
}
|
||||||
|
|
||||||
const calcPosWhenTop = () => {
|
const calcPosWhenTop = () => {
|
||||||
let left: number;
|
let left: number, top: number;
|
||||||
let top: number;
|
|
||||||
|
|
||||||
if (props.anchorElement) {
|
if (props.anchorElement) {
|
||||||
left =
|
left =
|
||||||
|
@ -44,8 +43,7 @@ export function calcPopupPosition(
|
||||||
};
|
};
|
||||||
|
|
||||||
const calcPosWhenBottom = () => {
|
const calcPosWhenBottom = () => {
|
||||||
let left: number;
|
let left: number, top: number;
|
||||||
let top: number;
|
|
||||||
|
|
||||||
if (props.anchorElement) {
|
if (props.anchorElement) {
|
||||||
left =
|
left =
|
||||||
|
@ -70,8 +68,7 @@ export function calcPopupPosition(
|
||||||
};
|
};
|
||||||
|
|
||||||
const calcPosWhenLeft = () => {
|
const calcPosWhenLeft = () => {
|
||||||
let left: number;
|
let left: number, top: number;
|
||||||
let top: number;
|
|
||||||
|
|
||||||
if (props.anchorElement) {
|
if (props.anchorElement) {
|
||||||
left = rect.left + window.pageXOffset - contentWidth - props.innerMargin;
|
left = rect.left + window.pageXOffset - contentWidth - props.innerMargin;
|
||||||
|
@ -92,8 +89,7 @@ export function calcPopupPosition(
|
||||||
};
|
};
|
||||||
|
|
||||||
const calcPosWhenRight = () => {
|
const calcPosWhenRight = () => {
|
||||||
let left: number;
|
let left: number, top: number;
|
||||||
let top: number;
|
|
||||||
|
|
||||||
if (props.anchorElement) {
|
if (props.anchorElement) {
|
||||||
left =
|
left =
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
import * as mfm from "mfm-js";
|
||||||
import { expandKaTeXMacro } from "@/scripts/katex-macro";
|
import { expandKaTeXMacro } from "@/scripts/katex-macro";
|
||||||
import { defaultStore } from "@/store";
|
import { defaultStore } from "@/store";
|
||||||
import * as mfm from "mfm-js";
|
|
||||||
|
|
||||||
export function preprocess(text: string): string {
|
export function preprocess(text: string): string {
|
||||||
if (defaultStore.state.enableCustomKaTeXMacro) {
|
if (defaultStore.state.enableCustomKaTeXMacro) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { popup } from "@/os";
|
|
||||||
import type { Ref } from "vue";
|
import type { Ref } from "vue";
|
||||||
import { defineAsyncComponent, ref } from "vue";
|
import { defineAsyncComponent, ref } from "vue";
|
||||||
|
import { popup } from "@/os";
|
||||||
|
|
||||||
class ReactionPicker {
|
class ReactionPicker {
|
||||||
private src: Ref<HTMLElement | null> = ref(null);
|
private src: Ref<HTMLElement | null> = ref(null);
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
|
import type { DriveFile } from "firefish-js/built/entities";
|
||||||
|
import { ref } from "vue";
|
||||||
import { i18n } from "@/i18n";
|
import { i18n } from "@/i18n";
|
||||||
import * as os from "@/os";
|
import * as os from "@/os";
|
||||||
import { uploadFile } from "@/scripts/upload";
|
import { uploadFile } from "@/scripts/upload";
|
||||||
import { defaultStore } from "@/store";
|
import { defaultStore } from "@/store";
|
||||||
import { stream } from "@/stream";
|
import { stream } from "@/stream";
|
||||||
import type { DriveFile } from "firefish-js/built/entities";
|
|
||||||
import { ref } from "vue";
|
|
||||||
|
|
||||||
function select(
|
function select(
|
||||||
src: any,
|
src: any,
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
* 配列をシャッフル (破壊的)
|
* 配列をシャッフル (破壊的)
|
||||||
*/
|
*/
|
||||||
export function shuffle<T extends any[]>(array: T): T {
|
export function shuffle<T extends any[]>(array: T): T {
|
||||||
let currentIndex = array.length;
|
let currentIndex = array.length,
|
||||||
let randomIndex;
|
randomIndex;
|
||||||
|
|
||||||
// While there remain elements to shuffle.
|
// While there remain elements to shuffle.
|
||||||
while (currentIndex !== 0) {
|
while (currentIndex !== 0) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { globalEvents } from "@/events";
|
|
||||||
import tinycolor from "tinycolor2";
|
import tinycolor from "tinycolor2";
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
|
import { globalEvents } from "@/events";
|
||||||
|
|
||||||
export interface Theme {
|
export interface Theme {
|
||||||
id: string;
|
id: string;
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
|
import { readAndCompressImage } from "browser-image-resizer";
|
||||||
|
import type * as Misskey from "firefish-js";
|
||||||
|
import { reactive, ref } from "vue";
|
||||||
import { $i } from "@/account";
|
import { $i } from "@/account";
|
||||||
import { apiUrl } from "@/config";
|
import { apiUrl } from "@/config";
|
||||||
import { i18n } from "@/i18n";
|
import { i18n } from "@/i18n";
|
||||||
import { alert } from "@/os";
|
import { alert } from "@/os";
|
||||||
import { defaultStore } from "@/store";
|
import { defaultStore } from "@/store";
|
||||||
import { readAndCompressImage } from "browser-image-resizer";
|
|
||||||
import type * as Misskey from "firefish-js";
|
|
||||||
import { reactive, ref } from "vue";
|
|
||||||
|
|
||||||
interface Uploading {
|
interface Uploading {
|
||||||
id: string;
|
id: string;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
import { onDeactivated, onUnmounted, ref } from "vue";
|
||||||
import MkChartTooltip from "@/components/MkChartTooltip.vue";
|
import MkChartTooltip from "@/components/MkChartTooltip.vue";
|
||||||
import * as os from "@/os";
|
import * as os from "@/os";
|
||||||
import { onDeactivated, onUnmounted, ref } from "vue";
|
|
||||||
|
|
||||||
export function useChartTooltip(
|
export function useChartTooltip(
|
||||||
opts: { position: "top" | "middle" } = { position: "top" },
|
opts: { position: "top" | "middle" } = { position: "top" },
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { i18n } from "@/i18n";
|
|
||||||
import * as os from "@/os";
|
|
||||||
import type { Ref } from "vue";
|
import type { Ref } from "vue";
|
||||||
import { inject, onUnmounted } from "vue";
|
import { inject, onUnmounted } from "vue";
|
||||||
|
import { i18n } from "@/i18n";
|
||||||
|
import * as os from "@/os";
|
||||||
|
|
||||||
export function useLeaveGuard(enabled: Ref<boolean>) {
|
export function useLeaveGuard(enabled: Ref<boolean>) {
|
||||||
/* TODO
|
/* TODO
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import { $i } from "@/account";
|
|
||||||
import * as os from "@/os";
|
|
||||||
import { stream } from "@/stream";
|
|
||||||
import type * as misskey from "firefish-js";
|
import type * as misskey from "firefish-js";
|
||||||
import type { Ref } from "vue";
|
import type { Ref } from "vue";
|
||||||
import { onUnmounted } from "vue";
|
import { onUnmounted } from "vue";
|
||||||
|
import { $i } from "@/account";
|
||||||
|
import * as os from "@/os";
|
||||||
|
import { stream } from "@/stream";
|
||||||
|
|
||||||
export function useNoteCapture(props: {
|
export function useNoteCapture(props: {
|
||||||
rootEl: Ref<HTMLElement>;
|
rootEl: Ref<HTMLElement>;
|
||||||
|
|
|
@ -6,13 +6,13 @@ export function useTooltip(
|
||||||
onShow: (showing: Ref<boolean>) => void,
|
onShow: (showing: Ref<boolean>) => void,
|
||||||
delay = 300,
|
delay = 300,
|
||||||
): void {
|
): void {
|
||||||
let isHovering = false;
|
let isHovering = false,
|
||||||
// iOS(Androidも?)では、要素をタップした直後に(おせっかいで)mouseoverイベントを発火させたりするため、それを無視するためのフラグ
|
// iOS(Androidも?)では、要素をタップした直後に(おせっかいで)mouseoverイベントを発火させたりするため、それを無視するためのフラグ
|
||||||
// 無視しないと、画面に触れてないのにツールチップが出たりし、ユーザビリティが損なわれる
|
// 無視しないと、画面に触れてないのにツールチップが出たりし、ユーザビリティが損なわれる
|
||||||
// TODO: 一度でもタップすると二度とマウスでツールチップ出せなくなるのをどうにかする 定期的にfalseに戻すとか...?
|
// TODO: 一度でもタップすると二度とマウスでツールチップ出せなくなるのをどうにかする 定期的にfalseに戻すとか...?
|
||||||
let shouldIgnoreMouseover = false;
|
shouldIgnoreMouseover = false,
|
||||||
let timeoutId: number;
|
timeoutId: number,
|
||||||
let changeShowingState: (() => void) | null;
|
changeShowingState: (() => void) | null;
|
||||||
|
|
||||||
const open = () => {
|
const open = () => {
|
||||||
close();
|
close();
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import { $i } from "@/account";
|
|
||||||
import { url } from "@/config";
|
|
||||||
import * as Misskey from "firefish-js";
|
import * as Misskey from "firefish-js";
|
||||||
import { markRaw } from "vue";
|
import { markRaw } from "vue";
|
||||||
|
import { $i } from "@/account";
|
||||||
|
import { url } from "@/config";
|
||||||
|
|
||||||
export const stream = markRaw(
|
export const stream = markRaw(
|
||||||
new Misskey.Stream(
|
new Misskey.Stream(
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
|
import type { Theme } from "./scripts/theme";
|
||||||
import { $i } from "@/account";
|
import { $i } from "@/account";
|
||||||
import { api } from "@/os";
|
import { api } from "@/os";
|
||||||
import type { Theme } from "./scripts/theme";
|
|
||||||
|
|
||||||
const lsCacheKey = $i ? `themes:${$i.id}` : "";
|
const lsCacheKey = $i ? `themes:${$i.id}` : "";
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
|
import { inject } from "vue";
|
||||||
import { $i, login } from "@/account";
|
import { $i, login } from "@/account";
|
||||||
import { post } from "@/os";
|
import { post } from "@/os";
|
||||||
import { mainRouter } from "@/router";
|
import { mainRouter } from "@/router";
|
||||||
import { getAccountFromId } from "@/scripts/get-account-from-id";
|
import { getAccountFromId } from "@/scripts/get-account-from-id";
|
||||||
import { defaultStore } from "@/store";
|
import { defaultStore } from "@/store";
|
||||||
import { inject } from "vue";
|
|
||||||
|
|
||||||
export function swInject() {
|
export function swInject() {
|
||||||
navigator.serviceWorker.addEventListener("message", (ev) => {
|
navigator.serviceWorker.addEventListener("message", (ev) => {
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import { i18n } from "@/i18n";
|
|
||||||
import { api } from "@/os";
|
|
||||||
import { deepClone } from "@/scripts/clone";
|
|
||||||
import type { notificationTypes } from "firefish-js";
|
import type { notificationTypes } from "firefish-js";
|
||||||
import { throttle } from "throttle-debounce";
|
import { throttle } from "throttle-debounce";
|
||||||
import { markRaw } from "vue";
|
import { markRaw } from "vue";
|
||||||
import { Storage } from "../../pizzax";
|
import { Storage } from "../../pizzax";
|
||||||
|
import { deepClone } from "@/scripts/clone";
|
||||||
|
import { api } from "@/os";
|
||||||
|
import { i18n } from "@/i18n";
|
||||||
|
|
||||||
interface ColumnWidget {
|
interface ColumnWidget {
|
||||||
name: string;
|
name: string;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
|
import { throttle } from "throttle-debounce";
|
||||||
|
import { reactive, watch } from "vue";
|
||||||
import * as os from "@/os";
|
import * as os from "@/os";
|
||||||
import { deepClone } from "@/scripts/clone";
|
import { deepClone } from "@/scripts/clone";
|
||||||
import type { Form, GetFormResultType } from "@/scripts/form";
|
import type { Form, GetFormResultType } from "@/scripts/form";
|
||||||
import { throttle } from "throttle-debounce";
|
|
||||||
import { reactive, watch } from "vue";
|
|
||||||
|
|
||||||
export interface Widget<P extends Record<string, unknown>> {
|
export interface Widget<P extends Record<string, unknown>> {
|
||||||
id: string;
|
id: string;
|
||||||
|
|
Loading…
Reference in a new issue