chore: lint
This commit is contained in:
parent
97bb495636
commit
2d9d6e9fb7
@ -1,7 +1,7 @@
|
|||||||
import config from "@/config/index.js";
|
import config from "@/config/index.js";
|
||||||
import {
|
import {
|
||||||
DB_MAX_NOTE_TEXT_LENGTH,
|
|
||||||
DB_MAX_IMAGE_COMMENT_LENGTH,
|
DB_MAX_IMAGE_COMMENT_LENGTH,
|
||||||
|
DB_MAX_NOTE_TEXT_LENGTH,
|
||||||
} from "@/misc/hard-limits.js";
|
} from "@/misc/hard-limits.js";
|
||||||
|
|
||||||
export const MAX_NOTE_TEXT_LENGTH = Math.min(
|
export const MAX_NOTE_TEXT_LENGTH = Math.min(
|
||||||
|
2
packages/backend/src/global.d.ts
vendored
2
packages/backend/src/global.d.ts
vendored
@ -1,2 +1,2 @@
|
|||||||
// rome-ignore lint/suspicious/noExplicitAny: i have no idea
|
// biome-ignore lint/suspicious/noExplicitAny: i have no idea
|
||||||
type FIXME = any;
|
type FIXME = any;
|
||||||
|
@ -25,7 +25,8 @@ const assets = `${_dirname}/../../server/file/assets/`;
|
|||||||
const MAX_BYTE_RANGES = 10;
|
const MAX_BYTE_RANGES = 10;
|
||||||
|
|
||||||
const commonReadableHandlerGenerator =
|
const commonReadableHandlerGenerator =
|
||||||
(ctx: Koa.Context) => (e: Error): void => {
|
(ctx: Koa.Context) =>
|
||||||
|
(e: Error): void => {
|
||||||
serverLogger.error(e);
|
serverLogger.error(e);
|
||||||
ctx.status = 500;
|
ctx.status = 500;
|
||||||
ctx.set("Cache-Control", "max-age=300");
|
ctx.set("Cache-Control", "max-age=300");
|
||||||
|
@ -175,7 +175,8 @@ export default async (
|
|||||||
) =>
|
) =>
|
||||||
// biome-ignore lint/suspicious/noAsyncPromiseExecutor: FIXME
|
// biome-ignore lint/suspicious/noAsyncPromiseExecutor: FIXME
|
||||||
new Promise<Note>(async (res, rej) => {
|
new Promise<Note>(async (res, rej) => {
|
||||||
const dontFederateInitially = data.localOnly || data.visibility?.startsWith("hidden") === true;
|
const dontFederateInitially =
|
||||||
|
data.localOnly || data.visibility?.startsWith("hidden") === true;
|
||||||
|
|
||||||
// If you reply outside the channel, match the scope of the target.
|
// If you reply outside the channel, match the scope of the target.
|
||||||
// TODO (I think it's a process that could be done on the client side, but it's server side for now.)
|
// TODO (I think it's a process that could be done on the client side, but it's server side for now.)
|
||||||
|
@ -2,8 +2,8 @@ import * as assert from "assert";
|
|||||||
import httpSignature from "@peertube/http-signature";
|
import httpSignature from "@peertube/http-signature";
|
||||||
import { genRsaKeyPair } from "../src/misc/gen-key-pair.js";
|
import { genRsaKeyPair } from "../src/misc/gen-key-pair.js";
|
||||||
import {
|
import {
|
||||||
createSignedPost,
|
|
||||||
createSignedGet,
|
createSignedGet,
|
||||||
|
createSignedPost,
|
||||||
} from "../src/remote/activitypub/ap-request.js";
|
} from "../src/remote/activitypub/ap-request.js";
|
||||||
|
|
||||||
export const buildParsedSignature = (
|
export const buildParsedSignature = (
|
||||||
|
@ -4,11 +4,11 @@ import * as assert from "assert";
|
|||||||
import * as childProcess from "child_process";
|
import * as childProcess from "child_process";
|
||||||
import {
|
import {
|
||||||
async,
|
async,
|
||||||
signup,
|
|
||||||
request,
|
|
||||||
post,
|
post,
|
||||||
startServer,
|
request,
|
||||||
shutdownServer,
|
shutdownServer,
|
||||||
|
signup,
|
||||||
|
startServer,
|
||||||
} from "./utils.js";
|
} from "./utils.js";
|
||||||
|
|
||||||
describe("API visibility", () => {
|
describe("API visibility", () => {
|
||||||
|
@ -4,13 +4,13 @@ import * as assert from "assert";
|
|||||||
import * as childProcess from "child_process";
|
import * as childProcess from "child_process";
|
||||||
import {
|
import {
|
||||||
async,
|
async,
|
||||||
signup,
|
|
||||||
request,
|
|
||||||
post,
|
post,
|
||||||
react,
|
react,
|
||||||
uploadFile,
|
request,
|
||||||
startServer,
|
|
||||||
shutdownServer,
|
shutdownServer,
|
||||||
|
signup,
|
||||||
|
startServer,
|
||||||
|
uploadFile,
|
||||||
} from "./utils.js";
|
} from "./utils.js";
|
||||||
|
|
||||||
describe("API", () => {
|
describe("API", () => {
|
||||||
|
@ -4,11 +4,11 @@ import * as assert from "assert";
|
|||||||
import * as childProcess from "child_process";
|
import * as childProcess from "child_process";
|
||||||
import {
|
import {
|
||||||
async,
|
async,
|
||||||
signup,
|
|
||||||
request,
|
|
||||||
post,
|
post,
|
||||||
startServer,
|
request,
|
||||||
shutdownServer,
|
shutdownServer,
|
||||||
|
signup,
|
||||||
|
startServer,
|
||||||
} from "./utils.js";
|
} from "./utils.js";
|
||||||
|
|
||||||
describe("Block", () => {
|
describe("Block", () => {
|
||||||
|
@ -2,11 +2,11 @@ process.env.NODE_ENV = "test";
|
|||||||
|
|
||||||
import * as assert from "assert";
|
import * as assert from "assert";
|
||||||
import * as lolex from "@sinonjs/fake-timers";
|
import * as lolex from "@sinonjs/fake-timers";
|
||||||
import TestChart from "../src/services/chart/charts/test.js";
|
|
||||||
import TestGroupedChart from "../src/services/chart/charts/test-grouped.js";
|
|
||||||
import TestUniqueChart from "../src/services/chart/charts/test-unique.js";
|
|
||||||
import TestIntersectionChart from "../src/services/chart/charts/test-intersection.js";
|
|
||||||
import { initDb } from "../src/db/postgre.js";
|
import { initDb } from "../src/db/postgre.js";
|
||||||
|
import TestGroupedChart from "../src/services/chart/charts/test-grouped.js";
|
||||||
|
import TestIntersectionChart from "../src/services/chart/charts/test-intersection.js";
|
||||||
|
import TestUniqueChart from "../src/services/chart/charts/test-unique.js";
|
||||||
|
import TestChart from "../src/services/chart/charts/test.js";
|
||||||
|
|
||||||
describe("Chart", () => {
|
describe("Chart", () => {
|
||||||
let testChart: TestChart;
|
let testChart: TestChart;
|
||||||
|
@ -5,13 +5,13 @@ import * as childProcess from "child_process";
|
|||||||
import * as openapi from "@redocly/openapi-core";
|
import * as openapi from "@redocly/openapi-core";
|
||||||
import {
|
import {
|
||||||
async,
|
async,
|
||||||
startServer,
|
port,
|
||||||
signup,
|
|
||||||
post,
|
post,
|
||||||
request,
|
request,
|
||||||
simpleGet,
|
|
||||||
port,
|
|
||||||
shutdownServer,
|
shutdownServer,
|
||||||
|
signup,
|
||||||
|
simpleGet,
|
||||||
|
startServer,
|
||||||
} from "./utils.js";
|
} from "./utils.js";
|
||||||
|
|
||||||
// Request Accept
|
// Request Accept
|
||||||
|
@ -4,14 +4,14 @@ import * as assert from "assert";
|
|||||||
import * as childProcess from "child_process";
|
import * as childProcess from "child_process";
|
||||||
import {
|
import {
|
||||||
async,
|
async,
|
||||||
signup,
|
connectStream,
|
||||||
request,
|
|
||||||
post,
|
post,
|
||||||
react,
|
react,
|
||||||
connectStream,
|
request,
|
||||||
startServer,
|
|
||||||
shutdownServer,
|
shutdownServer,
|
||||||
|
signup,
|
||||||
simpleGet,
|
simpleGet,
|
||||||
|
startServer,
|
||||||
} from "./utils.js";
|
} from "./utils.js";
|
||||||
|
|
||||||
describe("FF visibility", () => {
|
describe("FF visibility", () => {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import * as assert from "assert";
|
import * as assert from "assert";
|
||||||
import { fileURLToPath } from "node:url";
|
|
||||||
import { dirname } from "node:path";
|
import { dirname } from "node:path";
|
||||||
|
import { fileURLToPath } from "node:url";
|
||||||
import { getFileInfo } from "../src/misc/get-file-info.js";
|
import { getFileInfo } from "../src/misc/get-file-info.js";
|
||||||
import { async } from "./utils.js";
|
import { async } from "./utils.js";
|
||||||
|
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import * as assert from "assert";
|
import * as assert from "assert";
|
||||||
import * as mfm from "mfm-js";
|
import * as mfm from "mfm-js";
|
||||||
|
|
||||||
import { toHtml } from "../src/mfm/to-html.js";
|
|
||||||
import { fromHtml } from "../src/mfm/from-html.js";
|
import { fromHtml } from "../src/mfm/from-html.js";
|
||||||
|
import { toHtml } from "../src/mfm/to-html.js";
|
||||||
|
|
||||||
describe("toHtml", () => {
|
describe("toHtml", () => {
|
||||||
it("br", () => {
|
it("br", () => {
|
||||||
|
@ -4,12 +4,12 @@ import * as assert from "assert";
|
|||||||
import * as childProcess from "child_process";
|
import * as childProcess from "child_process";
|
||||||
import {
|
import {
|
||||||
async,
|
async,
|
||||||
signup,
|
|
||||||
request,
|
|
||||||
post,
|
post,
|
||||||
react,
|
react,
|
||||||
startServer,
|
request,
|
||||||
shutdownServer,
|
shutdownServer,
|
||||||
|
signup,
|
||||||
|
startServer,
|
||||||
waitFire,
|
waitFire,
|
||||||
} from "./utils.js";
|
} from "./utils.js";
|
||||||
|
|
||||||
|
@ -4,15 +4,15 @@ import * as assert from "assert";
|
|||||||
import * as childProcess from "child_process";
|
import * as childProcess from "child_process";
|
||||||
import { Note } from "../src/models/entities/note.js";
|
import { Note } from "../src/models/entities/note.js";
|
||||||
import {
|
import {
|
||||||
async,
|
|
||||||
signup,
|
|
||||||
request,
|
|
||||||
post,
|
|
||||||
uploadUrl,
|
|
||||||
startServer,
|
|
||||||
shutdownServer,
|
|
||||||
initTestDb,
|
|
||||||
api,
|
api,
|
||||||
|
async,
|
||||||
|
initTestDb,
|
||||||
|
post,
|
||||||
|
request,
|
||||||
|
shutdownServer,
|
||||||
|
signup,
|
||||||
|
startServer,
|
||||||
|
uploadUrl,
|
||||||
} from "./utils.js";
|
} from "./utils.js";
|
||||||
|
|
||||||
describe("Note", () => {
|
describe("Note", () => {
|
||||||
|
@ -4,13 +4,13 @@ import * as assert from "assert";
|
|||||||
import * as childProcess from "child_process";
|
import * as childProcess from "child_process";
|
||||||
import { Following } from "../src/models/entities/following.js";
|
import { Following } from "../src/models/entities/following.js";
|
||||||
import {
|
import {
|
||||||
connectStream,
|
|
||||||
signup,
|
|
||||||
api,
|
api,
|
||||||
post,
|
connectStream,
|
||||||
startServer,
|
|
||||||
shutdownServer,
|
|
||||||
initTestDb,
|
initTestDb,
|
||||||
|
post,
|
||||||
|
shutdownServer,
|
||||||
|
signup,
|
||||||
|
startServer,
|
||||||
waitFire,
|
waitFire,
|
||||||
} from "./utils.js";
|
} from "./utils.js";
|
||||||
|
|
||||||
|
@ -4,13 +4,13 @@ import * as assert from "assert";
|
|||||||
import * as childProcess from "child_process";
|
import * as childProcess from "child_process";
|
||||||
import {
|
import {
|
||||||
async,
|
async,
|
||||||
signup,
|
connectStream,
|
||||||
request,
|
|
||||||
post,
|
post,
|
||||||
react,
|
react,
|
||||||
connectStream,
|
request,
|
||||||
startServer,
|
|
||||||
shutdownServer,
|
shutdownServer,
|
||||||
|
signup,
|
||||||
|
startServer,
|
||||||
} from "./utils.js";
|
} from "./utils.js";
|
||||||
|
|
||||||
describe("Note thread mute", () => {
|
describe("Note thread mute", () => {
|
||||||
|
@ -4,12 +4,12 @@ import * as assert from "assert";
|
|||||||
import * as childProcess from "child_process";
|
import * as childProcess from "child_process";
|
||||||
import {
|
import {
|
||||||
async,
|
async,
|
||||||
signup,
|
|
||||||
request,
|
|
||||||
post,
|
post,
|
||||||
uploadUrl,
|
request,
|
||||||
startServer,
|
|
||||||
shutdownServer,
|
shutdownServer,
|
||||||
|
signup,
|
||||||
|
startServer,
|
||||||
|
uploadUrl,
|
||||||
} from "./utils.js";
|
} from "./utils.js";
|
||||||
|
|
||||||
describe("users/notes", () => {
|
describe("users/notes", () => {
|
||||||
|
@ -1,18 +1,18 @@
|
|||||||
import * as fs from "node:fs";
|
|
||||||
import * as path from "node:path";
|
|
||||||
import { fileURLToPath } from "node:url";
|
|
||||||
import { dirname } from "node:path";
|
|
||||||
import * as childProcess from "child_process";
|
import * as childProcess from "child_process";
|
||||||
import * as http from "node:http";
|
|
||||||
import { SIGKILL } from "constants";
|
import { SIGKILL } from "constants";
|
||||||
import WebSocket from "ws";
|
import * as fs from "node:fs";
|
||||||
|
import * as http from "node:http";
|
||||||
|
import * as path from "node:path";
|
||||||
|
import { dirname } from "node:path";
|
||||||
|
import { fileURLToPath } from "node:url";
|
||||||
import * as firefish from "firefish-js";
|
import * as firefish from "firefish-js";
|
||||||
import fetch from "node-fetch";
|
|
||||||
import FormData from "form-data";
|
import FormData from "form-data";
|
||||||
|
import got from "got";
|
||||||
|
import fetch from "node-fetch";
|
||||||
import { DataSource } from "typeorm";
|
import { DataSource } from "typeorm";
|
||||||
|
import WebSocket from "ws";
|
||||||
import loadConfig from "../src/config/load.js";
|
import loadConfig from "../src/config/load.js";
|
||||||
import { entities } from "../src/db/postgre.js";
|
import { entities } from "../src/db/postgre.js";
|
||||||
import got from "got";
|
|
||||||
|
|
||||||
const _filename = fileURLToPath(import.meta.url);
|
const _filename = fileURLToPath(import.meta.url);
|
||||||
const _dirname = dirname(_filename);
|
const _dirname = dirname(_filename);
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
import { defineAsyncComponent } from "vue";
|
|
||||||
import type * as firefish from "firefish-js";
|
import type * as firefish from "firefish-js";
|
||||||
|
import { defineAsyncComponent } from "vue";
|
||||||
import { i18n } from "./i18n";
|
import { i18n } from "./i18n";
|
||||||
import { del, get, set } from "@/scripts/idb-proxy";
|
|
||||||
import { apiUrl } from "@/config";
|
import { apiUrl } from "@/config";
|
||||||
import { alert, api, popup, popupMenu, waiting } from "@/os";
|
import { alert, api, popup, popupMenu, waiting } from "@/os";
|
||||||
import { reloadChannel, unisonReload } from "@/scripts/unison-reload";
|
|
||||||
import icon from "@/scripts/icon";
|
|
||||||
import { $i } from "@/reactiveAccount";
|
import { $i } from "@/reactiveAccount";
|
||||||
|
import icon from "@/scripts/icon";
|
||||||
|
import { del, get, set } from "@/scripts/idb-proxy";
|
||||||
|
import { reloadChannel, unisonReload } from "@/scripts/unison-reload";
|
||||||
|
|
||||||
// TODO: 他のタブと永続化されたstateを同期
|
// TODO: 他のタブと永続化されたstateを同期
|
||||||
|
|
||||||
|
@ -46,17 +46,27 @@ const relative = computed<string>(() => {
|
|||||||
return ago >= 31536000
|
return ago >= 31536000
|
||||||
? i18n.t("_ago.yearsAgo", { n: Math.floor(ago / 31536000).toString() })
|
? i18n.t("_ago.yearsAgo", { n: Math.floor(ago / 31536000).toString() })
|
||||||
: ago >= 2592000
|
: ago >= 2592000
|
||||||
? i18n.t("_ago.monthsAgo", { n: Math.floor(ago / 2592000).toString() })
|
? i18n.t("_ago.monthsAgo", {
|
||||||
|
n: Math.floor(ago / 2592000).toString(),
|
||||||
|
})
|
||||||
: ago >= 604800
|
: ago >= 604800
|
||||||
? i18n.t("_ago.weeksAgo", { n: Math.floor(ago / 604800).toString() })
|
? i18n.t("_ago.weeksAgo", {
|
||||||
|
n: Math.floor(ago / 604800).toString(),
|
||||||
|
})
|
||||||
: ago >= 86400
|
: ago >= 86400
|
||||||
? i18n.t("_ago.daysAgo", { n: Math.floor(ago / 86400).toString() })
|
? i18n.t("_ago.daysAgo", {
|
||||||
|
n: Math.floor(ago / 86400).toString(),
|
||||||
|
})
|
||||||
: ago >= 3600
|
: ago >= 3600
|
||||||
? i18n.t("_ago.hoursAgo", { n: Math.floor(ago / 3600).toString() })
|
? i18n.t("_ago.hoursAgo", {
|
||||||
|
n: Math.floor(ago / 3600).toString(),
|
||||||
|
})
|
||||||
: ago >= 60
|
: ago >= 60
|
||||||
? i18n.t("_ago.minutesAgo", { n: (~~(ago / 60)).toString() })
|
? i18n.t("_ago.minutesAgo", { n: (~~(ago / 60)).toString() })
|
||||||
: ago >= 10
|
: ago >= 10
|
||||||
? i18n.t("_ago.secondsAgo", { n: (~~(ago % 60)).toString() })
|
? i18n.t("_ago.secondsAgo", {
|
||||||
|
n: (~~(ago % 60)).toString(),
|
||||||
|
})
|
||||||
: ago >= -1
|
: ago >= -1
|
||||||
? i18n.ts._ago.justNow
|
? i18n.ts._ago.justNow
|
||||||
: i18n.ts._ago.future;
|
: i18n.ts._ago.future;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
import type { Ref } from "vue";
|
||||||
import Ripple from "@/components/MkRipple.vue";
|
import Ripple from "@/components/MkRipple.vue";
|
||||||
import { popup } from "@/os";
|
import { popup } from "@/os";
|
||||||
import type { Ref } from "vue";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mounted(el: HTMLElement, binding: Ref<boolean>) {
|
mounted(el: HTMLElement, binding: Ref<boolean>) {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { entities } from "firefish-js";
|
import type { entities } from "firefish-js";
|
||||||
|
|
||||||
export const notePage = (note: entities.Note) => {
|
export const notePage = (note: entities.Note) => {
|
||||||
return `/notes/${note.id}`;
|
return `/notes/${note.id}`;
|
||||||
|
@ -7,11 +7,11 @@ import "vite/modulepreload-polyfill";
|
|||||||
|
|
||||||
import "@/style.scss";
|
import "@/style.scss";
|
||||||
|
|
||||||
import "@phosphor-icons/web/fill";
|
|
||||||
import "@phosphor-icons/web/bold";
|
import "@phosphor-icons/web/bold";
|
||||||
import "@phosphor-icons/web/regular";
|
|
||||||
import "@phosphor-icons/web/light";
|
|
||||||
import "@phosphor-icons/web/duotone";
|
import "@phosphor-icons/web/duotone";
|
||||||
|
import "@phosphor-icons/web/fill";
|
||||||
|
import "@phosphor-icons/web/light";
|
||||||
|
import "@phosphor-icons/web/regular";
|
||||||
|
|
||||||
// #region account indexedDB migration
|
// #region account indexedDB migration
|
||||||
|
|
||||||
@ -22,6 +22,7 @@ if (accounts) {
|
|||||||
}
|
}
|
||||||
// #endregion
|
// #endregion
|
||||||
|
|
||||||
|
import { compareVersions } from "compare-versions";
|
||||||
import {
|
import {
|
||||||
computed,
|
computed,
|
||||||
createApp,
|
createApp,
|
||||||
@ -30,31 +31,30 @@ import {
|
|||||||
version as vueVersion,
|
version as vueVersion,
|
||||||
watch,
|
watch,
|
||||||
} from "vue";
|
} from "vue";
|
||||||
import { compareVersions } from "compare-versions";
|
|
||||||
import { set } from "@/scripts/idb-proxy";
|
import { set } from "@/scripts/idb-proxy";
|
||||||
|
|
||||||
import widgets from "@/widgets";
|
import { login, refreshAccount, signout, updateAccount } from "@/account";
|
||||||
import directives from "@/directives";
|
|
||||||
import components from "@/components";
|
import components from "@/components";
|
||||||
import { lang, ui, version } from "@/config";
|
import { lang, ui, version } from "@/config";
|
||||||
import { applyTheme } from "@/scripts/theme";
|
import directives from "@/directives";
|
||||||
import { isDeviceDarkmode } from "@/scripts/is-device-darkmode";
|
|
||||||
import { i18n } from "@/i18n";
|
import { i18n } from "@/i18n";
|
||||||
import { alert, api, confirm, popup, post, toast } from "@/os";
|
|
||||||
import { stream } from "@/stream";
|
|
||||||
import * as sound from "@/scripts/sound";
|
|
||||||
import { login, refreshAccount, signout, updateAccount } from "@/account";
|
|
||||||
import { $i } from "@/reactiveAccount";
|
|
||||||
import { ColdDeviceStorage, defaultStore } from "@/store";
|
|
||||||
import { fetchInstance, instance } from "@/instance";
|
import { fetchInstance, instance } from "@/instance";
|
||||||
import { makeHotkey } from "@/scripts/hotkey";
|
import { alert, api, confirm, popup, post, toast } from "@/os";
|
||||||
import { search } from "@/scripts/search";
|
import { $i } from "@/reactiveAccount";
|
||||||
import { deviceKind } from "@/scripts/device-kind";
|
import { deviceKind } from "@/scripts/device-kind";
|
||||||
import { initializeSw } from "@/scripts/initialize-sw";
|
|
||||||
import { reloadChannel } from "@/scripts/unison-reload";
|
|
||||||
import { reactionPicker } from "@/scripts/reaction-picker";
|
|
||||||
import { getUrlWithoutLoginId } from "@/scripts/login-id";
|
|
||||||
import { getAccountFromId } from "@/scripts/get-account-from-id";
|
import { getAccountFromId } from "@/scripts/get-account-from-id";
|
||||||
|
import { makeHotkey } from "@/scripts/hotkey";
|
||||||
|
import { initializeSw } from "@/scripts/initialize-sw";
|
||||||
|
import { isDeviceDarkmode } from "@/scripts/is-device-darkmode";
|
||||||
|
import { getUrlWithoutLoginId } from "@/scripts/login-id";
|
||||||
|
import { reactionPicker } from "@/scripts/reaction-picker";
|
||||||
|
import { search } from "@/scripts/search";
|
||||||
|
import * as sound from "@/scripts/sound";
|
||||||
|
import { applyTheme } from "@/scripts/theme";
|
||||||
|
import { reloadChannel } from "@/scripts/unison-reload";
|
||||||
|
import { ColdDeviceStorage, defaultStore } from "@/store";
|
||||||
|
import { stream } from "@/stream";
|
||||||
|
import widgets from "@/widgets";
|
||||||
|
|
||||||
function checkForSplash() {
|
function checkForSplash() {
|
||||||
const splash = document.getElementById("splash");
|
const splash = document.getElementById("splash");
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { computed, reactive } from "vue";
|
|
||||||
import type * as firefish from "firefish-js";
|
import type * as firefish from "firefish-js";
|
||||||
|
import { computed, reactive } from "vue";
|
||||||
import { api } from "./os";
|
import { api } from "./os";
|
||||||
|
|
||||||
// TODO: 他のタブと永続化されたstateを同期
|
// TODO: 他のタブと永続化されたstateを同期
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import { computed, reactive } from "vue";
|
import { computed, reactive } from "vue";
|
||||||
import { $i } from "@/reactiveAccount";
|
|
||||||
import { search } from "@/scripts/search";
|
|
||||||
import * as os from "@/os";
|
|
||||||
import { i18n } from "@/i18n";
|
|
||||||
import { ui } from "@/config";
|
import { ui } from "@/config";
|
||||||
import { unisonReload } from "@/scripts/unison-reload";
|
import { i18n } from "@/i18n";
|
||||||
|
import * as os from "@/os";
|
||||||
|
import { $i } from "@/reactiveAccount";
|
||||||
import icon from "@/scripts/icon";
|
import icon from "@/scripts/icon";
|
||||||
|
import { search } from "@/scripts/search";
|
||||||
|
import { unisonReload } from "@/scripts/unison-reload";
|
||||||
|
|
||||||
export const navbarItemDef = reactive({
|
export const navbarItemDef = reactive({
|
||||||
notifications: {
|
notifications: {
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
import { EventEmitter } from "eventemitter3";
|
import { EventEmitter } from "eventemitter3";
|
||||||
import type { Component, ShallowRef } from "vue";
|
import type { Component, ShallowRef } from "vue";
|
||||||
import { shallowRef } from "vue";
|
import { shallowRef } from "vue";
|
||||||
import { pleaseLogin } from "@/scripts/please-login";
|
|
||||||
import { safeURIDecode } from "@/scripts/safe-uri-decode";
|
import { safeURIDecode } from "@/scripts/safe-uri-decode";
|
||||||
|
import { pleaseLogin } from "@/scripts/please-login";
|
||||||
|
|
||||||
interface RouteDef {
|
interface RouteDef {
|
||||||
path: string;
|
path: string;
|
||||||
@ -112,7 +112,7 @@ export class Router extends EventEmitter<{
|
|||||||
let parts = [..._parts];
|
let parts = [..._parts];
|
||||||
const props = new Map<string, string>();
|
const props = new Map<string, string>();
|
||||||
|
|
||||||
pathMatchLoop: for (const p of parsePath(route.path)) {
|
for (const p of parsePath(route.path)) {
|
||||||
if (typeof p === "string") {
|
if (typeof p === "string") {
|
||||||
if (p === parts[0]) {
|
if (p === parts[0]) {
|
||||||
parts.shift();
|
parts.shift();
|
||||||
@ -128,7 +128,7 @@ export class Router extends EventEmitter<{
|
|||||||
props.set(p.name, safeURIDecode(parts.join("/")));
|
props.set(p.name, safeURIDecode(parts.join("/")));
|
||||||
parts = [];
|
parts = [];
|
||||||
}
|
}
|
||||||
break pathMatchLoop;
|
break;
|
||||||
} else {
|
} else {
|
||||||
if (p.startsWith) {
|
if (p.startsWith) {
|
||||||
if (parts[0] == null || !parts[0].startsWith(p.startsWith))
|
if (parts[0] == null || !parts[0].startsWith(p.startsWith))
|
||||||
@ -159,7 +159,7 @@ export class Router extends EventEmitter<{
|
|||||||
child,
|
child,
|
||||||
};
|
};
|
||||||
} else {
|
} else {
|
||||||
continue forEachRouteLoop;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,18 +1,18 @@
|
|||||||
// TODO: なんでもかんでもos.tsに突っ込むのやめたいのでよしなに分割する
|
// TODO: なんでもかんでもos.tsに突っ込むのやめたいのでよしなに分割する
|
||||||
|
|
||||||
|
import { EventEmitter } from "eventemitter3";
|
||||||
|
import * as firefish from "firefish-js";
|
||||||
|
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 { EventEmitter } from "eventemitter3";
|
|
||||||
import insertTextAtCursor from "insert-text-at-cursor";
|
|
||||||
import * as firefish from "firefish-js";
|
|
||||||
import { i18n } from "./i18n";
|
import { i18n } from "./i18n";
|
||||||
import { apiUrl, url } from "@/config";
|
|
||||||
import MkPostFormDialog from "@/components/MkPostFormDialog.vue";
|
|
||||||
import MkWaitingDialog from "@/components/MkWaitingDialog.vue";
|
|
||||||
import MkToast from "@/components/MkToast.vue";
|
|
||||||
import MkDialog from "@/components/MkDialog.vue";
|
import MkDialog from "@/components/MkDialog.vue";
|
||||||
import type { MenuItem } from "@/types/menu";
|
import MkPostFormDialog from "@/components/MkPostFormDialog.vue";
|
||||||
|
import MkToast from "@/components/MkToast.vue";
|
||||||
|
import MkWaitingDialog from "@/components/MkWaitingDialog.vue";
|
||||||
|
import { apiUrl, url } from "@/config";
|
||||||
import { $i } from "@/reactiveAccount";
|
import { $i } from "@/reactiveAccount";
|
||||||
|
import type { MenuItem } from "@/types/menu";
|
||||||
|
|
||||||
export const pendingApiRequestsCount = ref(0);
|
export const pendingApiRequestsCount = ref(0);
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
/></template>
|
/></template>
|
||||||
<MkSpacer :content-max="800">
|
<MkSpacer :content-max="800">
|
||||||
<div class="attachments-timeline">
|
<div class="attachments-timeline">
|
||||||
<XTimeline ref="tl" class="tl" src="file" :fileId="fileId" />
|
<XTimeline ref="tl" class="tl" src="file" :file-id="fileId" />
|
||||||
</div>
|
</div>
|
||||||
</MkSpacer>
|
</MkSpacer>
|
||||||
</MkStickyContainer>
|
</MkStickyContainer>
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
import { defineAsyncComponent, nextTick, ref } from "vue";
|
import { defineAsyncComponent, nextTick, ref } from "vue";
|
||||||
import { Interpreter, Parser, utils } from "@syuilo/aiscript";
|
import { Interpreter, Parser, utils } from "@syuilo/aiscript";
|
||||||
import { v4 as uuid } from "uuid";
|
import { v4 as uuid } from "uuid";
|
||||||
|
import { compareVersions } from "compare-versions";
|
||||||
import FormTextarea from "@/components/form/textarea.vue";
|
import FormTextarea from "@/components/form/textarea.vue";
|
||||||
import FormButton from "@/components/MkButton.vue";
|
import FormButton from "@/components/MkButton.vue";
|
||||||
import FormInfo from "@/components/MkInfo.vue";
|
import FormInfo from "@/components/MkInfo.vue";
|
||||||
@ -29,7 +30,6 @@ import { ColdDeviceStorage } from "@/store";
|
|||||||
import { unisonReload } from "@/scripts/unison-reload";
|
import { unisonReload } from "@/scripts/unison-reload";
|
||||||
import { i18n } from "@/i18n";
|
import { i18n } from "@/i18n";
|
||||||
import { definePageMetadata } from "@/scripts/page-metadata";
|
import { definePageMetadata } from "@/scripts/page-metadata";
|
||||||
import { compareVersions } from "compare-versions";
|
|
||||||
import icon from "@/scripts/icon";
|
import icon from "@/scripts/icon";
|
||||||
|
|
||||||
const code = ref<string>();
|
const code = ref<string>();
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Interpreter, Parser, utils, values } from "@syuilo/aiscript";
|
import { Interpreter, Parser, utils, values } from "@syuilo/aiscript";
|
||||||
import { createAiScriptEnv } from "@/scripts/aiscript/api";
|
|
||||||
import { inputText } from "@/os";
|
import { inputText } from "@/os";
|
||||||
|
import { createAiScriptEnv } from "@/scripts/aiscript/api";
|
||||||
import {
|
import {
|
||||||
noteActions,
|
noteActions,
|
||||||
notePostInterruptors,
|
notePostInterruptors,
|
||||||
@ -114,7 +114,10 @@ function createPluginEnv(opts) {
|
|||||||
});
|
});
|
||||||
}),
|
}),
|
||||||
"Plugin:register_page_view_interruptor": values.FN_NATIVE(([handler]) => {
|
"Plugin:register_page_view_interruptor": values.FN_NATIVE(([handler]) => {
|
||||||
registerPageViewInterruptor({ pluginId: opts.plugin.id, handler });
|
registerPageViewInterruptor({
|
||||||
|
pluginId: opts.plugin.id,
|
||||||
|
handler,
|
||||||
|
});
|
||||||
}),
|
}),
|
||||||
"Plugin:open_url": values.FN_NATIVE(([url]) => {
|
"Plugin:open_url": values.FN_NATIVE(([url]) => {
|
||||||
window.open(url.value, "_blank");
|
window.open(url.value, "_blank");
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
import type { AsyncComponentLoader } from "vue";
|
import type { AsyncComponentLoader } from "vue";
|
||||||
import { defineAsyncComponent, inject } from "vue";
|
import { defineAsyncComponent, inject } from "vue";
|
||||||
import { Router } from "@/nirax";
|
|
||||||
import { iAmModerator } from "@/account";
|
import { iAmModerator } from "@/account";
|
||||||
import { $i } from "@/reactiveAccount";
|
import { Router } from "@/nirax";
|
||||||
import MkLoading from "@/pages/_loading_.vue";
|
|
||||||
import MkError from "@/pages/_error_.vue";
|
import MkError from "@/pages/_error_.vue";
|
||||||
|
import MkLoading from "@/pages/_loading_.vue";
|
||||||
|
import { $i } from "@/reactiveAccount";
|
||||||
// import { api } from "@/os";
|
// import { api } from "@/os";
|
||||||
|
|
||||||
// function getGuestTimelineStatus() {
|
// function getGuestTimelineStatus() {
|
||||||
|
@ -88,7 +88,11 @@ export class Autocomplete {
|
|||||||
const isHashtag = hashtagIndex !== -1;
|
const isHashtag = hashtagIndex !== -1;
|
||||||
const isMfmTag = mfmTagIndex !== -1;
|
const isMfmTag = mfmTagIndex !== -1;
|
||||||
const isEmoji =
|
const isEmoji =
|
||||||
emojiIndex !== -1 && text.split(/:[a-z0-9_+\-]+:/).pop()!.includes(":");
|
emojiIndex !== -1 &&
|
||||||
|
text
|
||||||
|
.split(/:[a-z0-9_+\-]+:/)
|
||||||
|
.pop()!
|
||||||
|
.includes(":");
|
||||||
|
|
||||||
let opened = false;
|
let opened = false;
|
||||||
|
|
||||||
|
@ -385,11 +385,11 @@ interface Plugin {
|
|||||||
ast: any[];
|
ast: any[];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
import darkTheme from "@/themes/d-rosepine.json5";
|
||||||
/**
|
/**
|
||||||
* Storage for configuration information that does not need to be constantly loaded into memory (non-reactive)
|
* Storage for configuration information that does not need to be constantly loaded into memory (non-reactive)
|
||||||
*/
|
*/
|
||||||
import lightTheme from "@/themes/l-rosepinedawn.json5";
|
import lightTheme from "@/themes/l-rosepinedawn.json5";
|
||||||
import darkTheme from "@/themes/d-rosepine.json5";
|
|
||||||
|
|
||||||
export class ColdDeviceStorage {
|
export class ColdDeviceStorage {
|
||||||
public static default = {
|
public static default = {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import * as firefish from "firefish-js";
|
import * as firefish from "firefish-js";
|
||||||
import { markRaw } from "vue";
|
import { markRaw } from "vue";
|
||||||
import { $i } from "@/reactiveAccount";
|
|
||||||
import { url } from "@/config";
|
import { url } from "@/config";
|
||||||
|
import { $i } from "@/reactiveAccount";
|
||||||
|
|
||||||
export const stream = markRaw(
|
export const stream = markRaw(
|
||||||
new firefish.Stream(
|
new firefish.Stream(
|
||||||
|
@ -28,12 +28,12 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
import { Interpreter, Parser, utils } from "@syuilo/aiscript";
|
import { Interpreter, Parser, utils } from "@syuilo/aiscript";
|
||||||
import {
|
import { useWidgetPropsManager } from "./widget";
|
||||||
useWidgetPropsManager,
|
import type {
|
||||||
WidgetComponentEmits,
|
WidgetComponentEmits,
|
||||||
|
WidgetComponentExpose,
|
||||||
WidgetComponentProps,
|
WidgetComponentProps,
|
||||||
} from "./widget";
|
} from "./widget";
|
||||||
import type { WidgetComponentExpose } from "./widget";
|
|
||||||
import type { GetFormResultType } from "@/scripts/form";
|
import type { GetFormResultType } from "@/scripts/form";
|
||||||
import * as os from "@/os";
|
import * as os from "@/os";
|
||||||
import MkContainer from "@/components/MkContainer.vue";
|
import MkContainer from "@/components/MkContainer.vue";
|
||||||
|
@ -9,13 +9,13 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onMounted, onUnmounted, ref, watch } from "vue";
|
import { onMounted, onUnmounted, ref, watch } from "vue";
|
||||||
import { Interpreter, Parser } from "@syuilo/aiscript";
|
import { Interpreter, Parser } from "@syuilo/aiscript";
|
||||||
import { createAiScriptEnv } from "@/scripts/aiscript/api";
|
import { useWidgetPropsManager } from "./widget";
|
||||||
import {
|
import type {
|
||||||
useWidgetPropsManager,
|
|
||||||
WidgetComponentEmits,
|
WidgetComponentEmits,
|
||||||
|
WidgetComponentExpose,
|
||||||
WidgetComponentProps,
|
WidgetComponentProps,
|
||||||
} from "./widget";
|
} from "./widget";
|
||||||
import type { WidgetComponentExpose } from "./widget";
|
import { createAiScriptEnv } from "@/scripts/aiscript/api";
|
||||||
import type { GetFormResultType } from "@/scripts/form";
|
import type { GetFormResultType } from "@/scripts/form";
|
||||||
import * as os from "@/os";
|
import * as os from "@/os";
|
||||||
import { $i } from "@/reactiveAccount";
|
import { $i } from "@/reactiveAccount";
|
||||||
|
@ -32,15 +32,9 @@
|
|||||||
"types": [
|
"types": [
|
||||||
"vite/client",
|
"vite/client",
|
||||||
],
|
],
|
||||||
"lib": [
|
"lib": ["esnext", "dom"],
|
||||||
"esnext",
|
|
||||||
"dom"
|
|
||||||
],
|
|
||||||
"jsx": "preserve"
|
"jsx": "preserve"
|
||||||
},
|
},
|
||||||
"compileOnSave": false,
|
"compileOnSave": false,
|
||||||
"include": [
|
"include": ["./**/*.ts", "./**/*.vue"]
|
||||||
"./**/*.ts",
|
|
||||||
"./**/*.vue"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user