refactor: firefish-js & backend-rs imports
This commit is contained in:
parent
834faaf6de
commit
09396e33a4
107 changed files with 389 additions and 427 deletions
|
@ -3,7 +3,7 @@ import {
|
|||
nativeCreateId,
|
||||
nativeInitIdGenerator,
|
||||
nativeGetTimestamp,
|
||||
} from "backend-rs/built/index.js";
|
||||
} from "backend-rs";
|
||||
|
||||
const length = Math.min(Math.max(config.cuid?.length ?? 16, 16), 24);
|
||||
const fingerprint = config.cuid?.fingerprint ?? "";
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { nativeRandomStr } from "backend-rs/built/index.js";
|
||||
import { nativeRandomStr } from "backend-rs";
|
||||
|
||||
export function secureRndstr(length = 32, _ = true): string {
|
||||
return nativeRandomStr(length);
|
||||
|
|
|
@ -23,11 +23,7 @@ import verifyEmail from "./private/verify-email.js";
|
|||
import { koaBody } from "koa-body";
|
||||
import { convertAttachment } from "./mastodon/converters.js";
|
||||
|
||||
// TODO?: should we avoid importing things from built directory?
|
||||
import {
|
||||
convertId,
|
||||
IdConvertType as IdType,
|
||||
} from "backend-rs/built/index.js";
|
||||
import { convertId, IdConvertType as IdType } from "backend-rs";
|
||||
|
||||
// re-export native rust id conversion (function and enum)
|
||||
export { IdType, convertId };
|
||||
|
|
|
@ -2,8 +2,6 @@ process.env.NODE_ENV = "test";
|
|||
|
||||
import * as assert from "assert";
|
||||
import { inspect } from "node:util";
|
||||
import { DEFAULT_POLICIES } from "@/core/RoleService.js";
|
||||
import type { Packed } from "@/misc/json-schema.js";
|
||||
import {
|
||||
signup,
|
||||
post,
|
||||
|
@ -12,10 +10,9 @@ import {
|
|||
startServer,
|
||||
api,
|
||||
successfulApiCall,
|
||||
failedApiCall,
|
||||
uploadFile,
|
||||
} from "../utils.js";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import type { INestApplicationContext } from "@nestjs/common";
|
||||
|
||||
describe("ユーザー", () => {
|
||||
|
@ -34,16 +31,16 @@ describe("ユーザー", () => {
|
|||
};
|
||||
|
||||
// BUG misskey-jsとjson-schemaと実際に返ってくるデータが全部違う
|
||||
type UserLite = firefish.entities.UserLite & {
|
||||
type UserLite = entities.UserLite & {
|
||||
badgeRoles: any[];
|
||||
};
|
||||
|
||||
type UserDetailedNotMe = UserLite &
|
||||
firefish.entities.UserDetailed & {
|
||||
entities.UserDetailed & {
|
||||
roles: any[];
|
||||
};
|
||||
|
||||
type MeDetailed = UserDetailedNotMe & firefish.entities.MeDetailed;
|
||||
type MeDetailed = UserDetailedNotMe & entities.MeDetailed;
|
||||
|
||||
type User = MeDetailed & { token: string };
|
||||
|
||||
|
@ -183,12 +180,12 @@ describe("ユーザー", () => {
|
|||
|
||||
let root: User;
|
||||
let alice: User;
|
||||
let aliceNote: firefish.entities.Note;
|
||||
let alicePage: firefish.entities.Page;
|
||||
let aliceList: firefish.entities.UserList;
|
||||
let aliceNote: entities.Note;
|
||||
let alicePage: entities.Page;
|
||||
let aliceList: entities.UserList;
|
||||
|
||||
let bob: User;
|
||||
let bobNote: firefish.entities.Note;
|
||||
let bobNote: entities.Note;
|
||||
|
||||
let carol: User;
|
||||
let dave: User;
|
||||
|
|
|
@ -5,7 +5,7 @@ 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 type { endpoints, Entities } from "firefish-js";
|
||||
import FormData from "form-data";
|
||||
import got from "got";
|
||||
import fetch from "node-fetch";
|
||||
|
@ -113,8 +113,8 @@ export const signup = async (params?: any): Promise<any> => {
|
|||
|
||||
export const post = async (
|
||||
user: any,
|
||||
params?: firefish.Endpoints["notes/create"]["req"],
|
||||
): Promise<firefish.entities.Note> => {
|
||||
params?: Endpoints["notes/create"]["req"],
|
||||
): Promise<entities.Note> => {
|
||||
const q = Object.assign(
|
||||
{
|
||||
text: "test",
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import { defineAsyncComponent } from "vue";
|
||||
import { i18n } from "./i18n";
|
||||
import { apiUrl } from "@/config";
|
||||
|
@ -10,7 +10,7 @@ import { reloadChannel, unisonReload } from "@/scripts/unison-reload";
|
|||
|
||||
// TODO: 他のタブと永続化されたstateを同期
|
||||
|
||||
export type Account = firefish.entities.MeDetailed;
|
||||
export type Account = entities.MeDetailed;
|
||||
|
||||
export async function signout() {
|
||||
waiting();
|
||||
|
@ -149,8 +149,8 @@ export async function openAccountMenu(
|
|||
opts: {
|
||||
includeCurrentAccount?: boolean;
|
||||
withExtraOperation: boolean;
|
||||
active?: firefish.entities.UserDetailed["id"];
|
||||
onChoose?: (account: firefish.entities.UserDetailed) => void;
|
||||
active?: entities.UserDetailed["id"];
|
||||
onChoose?: (account: entities.UserDetailed) => void;
|
||||
},
|
||||
ev: MouseEvent,
|
||||
) {
|
||||
|
@ -182,7 +182,7 @@ export async function openAccountMenu(
|
|||
);
|
||||
}
|
||||
|
||||
async function switchAccount(account: firefish.entities.UserDetailed) {
|
||||
async function switchAccount(account: entities.UserDetailed) {
|
||||
const storedAccounts = await getAccounts();
|
||||
const token = storedAccounts.find((x) => x.id === account.id).token;
|
||||
switchAccountWithToken(token);
|
||||
|
@ -199,7 +199,7 @@ export async function openAccountMenu(
|
|||
userIds: storedAccounts.map((x) => x.id),
|
||||
});
|
||||
|
||||
function createItem(account: firefish.entities.UserDetailed) {
|
||||
function createItem(account: entities.UserDetailed) {
|
||||
return {
|
||||
type: "user",
|
||||
user: account,
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
|
||||
<script setup lang="ts">
|
||||
import { ref } from "vue";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import XWindow from "@/components/MkWindow.vue";
|
||||
import MkTextarea from "@/components/form/textarea.vue";
|
||||
import MkButton from "@/components/MkButton.vue";
|
||||
|
@ -50,7 +50,7 @@ import { i18n } from "@/i18n";
|
|||
import icon from "@/scripts/icon";
|
||||
|
||||
const props = defineProps<{
|
||||
user: firefish.entities.User;
|
||||
user: entities.User;
|
||||
initialComment?: string;
|
||||
}>();
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
<span class="name">
|
||||
<MkUserName :key="user.id" :user="user" />
|
||||
</span>
|
||||
<span class="username">@{{ acct(user) }}</span>
|
||||
<span class="username">@{{ acct.toString(user) }}</span>
|
||||
</li>
|
||||
<li
|
||||
tabindex="-1"
|
||||
|
@ -95,7 +95,7 @@ import {
|
|||
import contains from "@/scripts/contains";
|
||||
import { char2filePath } from "@/scripts/twemoji-base";
|
||||
import { getStaticImageUrl } from "@/scripts/get-static-image-url";
|
||||
import { acct } from "@/filters/user";
|
||||
import { acct } from "firefish-js";
|
||||
import * as os from "@/os";
|
||||
import { MFM_TAGS } from "@/scripts/mfm-tags";
|
||||
import { defaultStore } from "@/store";
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
:to="
|
||||
message.groupId
|
||||
? `/my/messaging/group/${message.groupId}`
|
||||
: `/my/messaging/${getAcct(
|
||||
: `/my/messaging/${acct.toString(
|
||||
isMe(message) ? message.recipient : message.user,
|
||||
)}`
|
||||
"
|
||||
|
@ -63,14 +63,11 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import * as Acct from "firefish-js/built/acct";
|
||||
import { i18n } from "@/i18n";
|
||||
import { acct } from "@/filters/user";
|
||||
import { acct } from "firefish-js";
|
||||
import { $i } from "@/reactiveAccount";
|
||||
|
||||
const getAcct = Acct.toString;
|
||||
|
||||
const props = defineProps<{
|
||||
defineProps<{
|
||||
message: Record<string, any>;
|
||||
}>();
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, ref } from "vue";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import Cropper from "cropperjs";
|
||||
import tinycolor from "tinycolor2";
|
||||
import XModalWindow from "@/components/MkModalWindow.vue";
|
||||
|
@ -49,13 +49,13 @@ import { query } from "@/scripts/url";
|
|||
import { i18n } from "@/i18n";
|
||||
|
||||
const emit = defineEmits<{
|
||||
(ev: "ok", cropped: firefish.entities.DriveFile): void;
|
||||
(ev: "ok", cropped: entities.DriveFile): void;
|
||||
(ev: "cancel"): void;
|
||||
(ev: "closed"): void;
|
||||
}>();
|
||||
|
||||
const props = defineProps<{
|
||||
file: firefish.entities.DriveFile;
|
||||
file: entities.DriveFile;
|
||||
aspectRatio: number;
|
||||
}>();
|
||||
|
||||
|
@ -68,7 +68,7 @@ let cropper: Cropper | null = null,
|
|||
loading = ref(true);
|
||||
|
||||
const ok = async () => {
|
||||
const promise = new Promise<firefish.entities.DriveFile>(async (res) => {
|
||||
const promise = new Promise<entities.DriveFile>(async (res) => {
|
||||
const croppedCanvas = await cropper?.getCropperSelection()?.$toCanvas();
|
||||
croppedCanvas.toBlob((blob) => {
|
||||
const formData = new FormData();
|
||||
|
|
|
@ -15,13 +15,13 @@
|
|||
<script lang="ts" setup>
|
||||
import { computed, ref } from "vue";
|
||||
import { length } from "stringz";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import { concat } from "@/scripts/array";
|
||||
import { i18n } from "@/i18n";
|
||||
|
||||
const props = defineProps<{
|
||||
modelValue: boolean;
|
||||
note: firefish.entities.Note;
|
||||
note: entities.Note;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
|
|
|
@ -203,7 +203,7 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { computed, onBeforeUnmount, onMounted, ref, shallowRef } from "vue";
|
||||
import * as Acct from "firefish-js/built/acct";
|
||||
import { acct } from "firefish-js";
|
||||
import MkModal from "@/components/MkModal.vue";
|
||||
import MkButton from "@/components/MkButton.vue";
|
||||
import MkInput from "@/components/form/input.vue";
|
||||
|
@ -387,7 +387,7 @@ async function openSearchFilters(ev) {
|
|||
action: () => {
|
||||
os.selectUser().then((user) => {
|
||||
inputValue.value = appendFilter(
|
||||
"from:@" + Acct.toString(user),
|
||||
"from:@" + acct.toString(user),
|
||||
);
|
||||
});
|
||||
},
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { computed, defineAsyncComponent, ref } from "vue";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import copyToClipboard from "@/scripts/copy-to-clipboard";
|
||||
import MkDriveFileThumbnail from "@/components/MkDriveFileThumbnail.vue";
|
||||
import bytes from "@/filters/bytes";
|
||||
|
@ -50,7 +50,7 @@ import icon from "@/scripts/icon";
|
|||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
file: firefish.entities.DriveFile;
|
||||
file: entities.DriveFile;
|
||||
isSelected?: boolean;
|
||||
selectMode?: boolean;
|
||||
}>(),
|
||||
|
@ -61,7 +61,7 @@ const props = withDefaults(
|
|||
);
|
||||
|
||||
const emit = defineEmits<{
|
||||
(ev: "chosen", r: firefish.entities.DriveFile): void;
|
||||
(ev: "chosen", r: entities.DriveFile): void;
|
||||
(ev: "dragstart"): void;
|
||||
(ev: "dragend"): void;
|
||||
}>();
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { computed, defineAsyncComponent, ref } from "vue";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import * as os from "@/os";
|
||||
import { i18n } from "@/i18n";
|
||||
import { defaultStore } from "@/store";
|
||||
|
@ -46,7 +46,7 @@ import icon from "@/scripts/icon";
|
|||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
folder: firefish.entities.DriveFolder;
|
||||
folder: entities.DriveFolder;
|
||||
isSelected?: boolean;
|
||||
selectMode?: boolean;
|
||||
}>(),
|
||||
|
@ -57,11 +57,11 @@ const props = withDefaults(
|
|||
);
|
||||
|
||||
const emit = defineEmits<{
|
||||
(ev: "chosen", v: firefish.entities.DriveFolder): void;
|
||||
(ev: "move", v: firefish.entities.DriveFolder): void;
|
||||
(ev: "upload", file: File, folder: firefish.entities.DriveFolder);
|
||||
(ev: "removeFile", v: firefish.entities.DriveFile["id"]): void;
|
||||
(ev: "removeFolder", v: firefish.entities.DriveFolder["id"]): void;
|
||||
(ev: "chosen", v: entities.DriveFolder): void;
|
||||
(ev: "move", v: entities.DriveFolder): void;
|
||||
(ev: "upload", file: File, folder: entities.DriveFolder);
|
||||
(ev: "removeFile", v: entities.DriveFile["id"]): void;
|
||||
(ev: "removeFolder", v: entities.DriveFolder["id"]): void;
|
||||
(ev: "dragstart"): void;
|
||||
(ev: "dragend"): void;
|
||||
}>();
|
||||
|
|
|
@ -15,28 +15,23 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from "vue";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import * as os from "@/os";
|
||||
import { i18n } from "@/i18n";
|
||||
import icon from "@/scripts/icon";
|
||||
|
||||
const props = defineProps<{
|
||||
folder?: firefish.entities.DriveFolder;
|
||||
parentFolder: firefish.entities.DriveFolder | null;
|
||||
folder?: entities.DriveFolder;
|
||||
parentFolder: entities.DriveFolder | null;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
(ev: "move", v?: firefish.entities.DriveFolder): void;
|
||||
(
|
||||
ev: "upload",
|
||||
file: File,
|
||||
folder?: firefish.entities.DriveFolder | null,
|
||||
): void;
|
||||
(ev: "removeFile", v: firefish.entities.DriveFile["id"]): void;
|
||||
(ev: "removeFolder", v: firefish.entities.DriveFolder["id"]): void;
|
||||
(ev: "move", v?: entities.DriveFolder): void;
|
||||
(ev: "upload", file: File, folder?: entities.DriveFolder | null): void;
|
||||
(ev: "removeFile", v: entities.DriveFile["id"]): void;
|
||||
(ev: "removeFolder", v: entities.DriveFolder["id"]): void;
|
||||
}>();
|
||||
|
||||
const hover = ref(false);
|
||||
const draghover = ref(false);
|
||||
|
||||
function onClick() {
|
||||
|
|
|
@ -145,7 +145,7 @@ import {
|
|||
ref,
|
||||
watch,
|
||||
} from "vue";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import MkButton from "./MkButton.vue";
|
||||
import XNavFolder from "@/components/MkDrive.navFolder.vue";
|
||||
import XFolder from "@/components/MkDrive.folder.vue";
|
||||
|
@ -159,7 +159,7 @@ import icon from "@/scripts/icon";
|
|||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
initialFolder?: firefish.entities.DriveFolder;
|
||||
initialFolder?: entities.DriveFolder;
|
||||
type?: string;
|
||||
multiple?: boolean;
|
||||
select?: "file" | "folder" | null;
|
||||
|
@ -173,30 +173,27 @@ const props = withDefaults(
|
|||
);
|
||||
|
||||
const emit = defineEmits<{
|
||||
(
|
||||
ev: "selected",
|
||||
v: firefish.entities.DriveFile | firefish.entities.DriveFolder,
|
||||
): void;
|
||||
(ev: "selected", v: entities.DriveFile | entities.DriveFolder): void;
|
||||
(
|
||||
ev: "change-selection",
|
||||
v: firefish.entities.DriveFile[] | firefish.entities.DriveFolder[],
|
||||
v: entities.DriveFile[] | entities.DriveFolder[],
|
||||
): void;
|
||||
(ev: "move-root"): void;
|
||||
(ev: "cd", v: firefish.entities.DriveFolder | null): void;
|
||||
(ev: "open-folder", v: firefish.entities.DriveFolder): void;
|
||||
(ev: "cd", v: entities.DriveFolder | null): void;
|
||||
(ev: "open-folder", v: entities.DriveFolder): void;
|
||||
}>();
|
||||
|
||||
const loadMoreFiles = ref<InstanceType<typeof MkButton>>();
|
||||
const fileInput = ref<HTMLInputElement>();
|
||||
|
||||
const folder = ref<firefish.entities.DriveFolder | null>(null);
|
||||
const files = ref<firefish.entities.DriveFile[]>([]);
|
||||
const folders = ref<firefish.entities.DriveFolder[]>([]);
|
||||
const folder = ref<entities.DriveFolder | null>(null);
|
||||
const files = ref<entities.DriveFile[]>([]);
|
||||
const folders = ref<entities.DriveFolder[]>([]);
|
||||
const moreFiles = ref(false);
|
||||
const moreFolders = ref(false);
|
||||
const hierarchyFolders = ref<firefish.entities.DriveFolder[]>([]);
|
||||
const selectedFiles = ref<firefish.entities.DriveFile[]>([]);
|
||||
const selectedFolders = ref<firefish.entities.DriveFolder[]>([]);
|
||||
const hierarchyFolders = ref<entities.DriveFolder[]>([]);
|
||||
const selectedFiles = ref<entities.DriveFile[]>([]);
|
||||
const selectedFolders = ref<entities.DriveFolder[]>([]);
|
||||
const uploadings = uploads;
|
||||
const connection = stream.useChannel("drive");
|
||||
const keepOriginal = ref<boolean>(defaultStore.state.keepOriginalUploading); // 外部渡しが多いので$refは使わないほうがよい
|
||||
|
@ -220,11 +217,11 @@ const ilFilesObserver = new IntersectionObserver(
|
|||
|
||||
watch(folder, () => emit("cd", folder.value));
|
||||
|
||||
function onStreamDriveFileCreated(file: firefish.entities.DriveFile) {
|
||||
function onStreamDriveFileCreated(file: entities.DriveFile) {
|
||||
addFile(file, true);
|
||||
}
|
||||
|
||||
function onStreamDriveFileUpdated(file: firefish.entities.DriveFile) {
|
||||
function onStreamDriveFileUpdated(file: entities.DriveFile) {
|
||||
const current = folder.value ? folder.value.id : null;
|
||||
if (current !== file.folderId) {
|
||||
removeFile(file);
|
||||
|
@ -237,15 +234,11 @@ function onStreamDriveFileDeleted(fileId: string) {
|
|||
removeFile(fileId);
|
||||
}
|
||||
|
||||
function onStreamDriveFolderCreated(
|
||||
createdFolder: firefish.entities.DriveFolder,
|
||||
) {
|
||||
function onStreamDriveFolderCreated(createdFolder: entities.DriveFolder) {
|
||||
addFolder(createdFolder, true);
|
||||
}
|
||||
|
||||
function onStreamDriveFolderUpdated(
|
||||
updatedFolder: firefish.entities.DriveFolder,
|
||||
) {
|
||||
function onStreamDriveFolderUpdated(updatedFolder: entities.DriveFolder) {
|
||||
const current = folder.value ? folder.value.id : null;
|
||||
if (current !== updatedFolder.parentId) {
|
||||
removeFolder(updatedFolder);
|
||||
|
@ -389,7 +382,7 @@ function createFolder() {
|
|||
});
|
||||
}
|
||||
|
||||
function renameFolder(folderToRename: firefish.entities.DriveFolder) {
|
||||
function renameFolder(folderToRename: entities.DriveFolder) {
|
||||
os.inputText({
|
||||
title: i18n.ts.renameFolder,
|
||||
placeholder: i18n.ts.inputNewFolderName,
|
||||
|
@ -406,7 +399,7 @@ function renameFolder(folderToRename: firefish.entities.DriveFolder) {
|
|||
});
|
||||
}
|
||||
|
||||
function deleteFolder(folderToDelete: firefish.entities.DriveFolder) {
|
||||
function deleteFolder(folderToDelete: entities.DriveFolder) {
|
||||
os.api("drive/folders/delete", {
|
||||
folderId: folderToDelete.id,
|
||||
})
|
||||
|
@ -439,10 +432,7 @@ function onChangeFileInput() {
|
|||
}
|
||||
}
|
||||
|
||||
function upload(
|
||||
file: File,
|
||||
folderToUpload?: firefish.entities.DriveFolder | null,
|
||||
) {
|
||||
function upload(file: File, folderToUpload?: entities.DriveFolder | null) {
|
||||
uploadFile(
|
||||
file,
|
||||
folderToUpload && typeof folderToUpload === "object"
|
||||
|
@ -455,7 +445,7 @@ function upload(
|
|||
});
|
||||
}
|
||||
|
||||
function chooseFile(file: firefish.entities.DriveFile) {
|
||||
function chooseFile(file: entities.DriveFile) {
|
||||
const isAlreadySelected = selectedFiles.value.some((f) => f.id === file.id);
|
||||
if (props.multiple) {
|
||||
if (isAlreadySelected) {
|
||||
|
@ -476,7 +466,7 @@ function chooseFile(file: firefish.entities.DriveFile) {
|
|||
}
|
||||
}
|
||||
|
||||
function chooseFolder(folderToChoose: firefish.entities.DriveFolder) {
|
||||
function chooseFolder(folderToChoose: entities.DriveFolder) {
|
||||
const isAlreadySelected = selectedFolders.value.some(
|
||||
(f) => f.id === folderToChoose.id,
|
||||
);
|
||||
|
@ -499,7 +489,7 @@ function chooseFolder(folderToChoose: firefish.entities.DriveFolder) {
|
|||
}
|
||||
}
|
||||
|
||||
function move(target?: firefish.entities.DriveFolder) {
|
||||
function move(target?: entities.DriveFolder) {
|
||||
if (!target) {
|
||||
goRoot();
|
||||
return;
|
||||
|
@ -527,10 +517,7 @@ function move(target?: firefish.entities.DriveFolder) {
|
|||
});
|
||||
}
|
||||
|
||||
function addFolder(
|
||||
folderToAdd: firefish.entities.DriveFolder,
|
||||
unshift = false,
|
||||
) {
|
||||
function addFolder(folderToAdd: entities.DriveFolder, unshift = false) {
|
||||
const current = folder.value ? folder.value.id : null;
|
||||
if (current !== folderToAdd.parentId) return;
|
||||
|
||||
|
@ -547,7 +534,7 @@ function addFolder(
|
|||
}
|
||||
}
|
||||
|
||||
function addFile(fileToAdd: firefish.entities.DriveFile, unshift = false) {
|
||||
function addFile(fileToAdd: entities.DriveFile, unshift = false) {
|
||||
const current = folder.value ? folder.value.id : null;
|
||||
if (current !== fileToAdd.folderId) return;
|
||||
|
||||
|
@ -564,30 +551,30 @@ function addFile(fileToAdd: firefish.entities.DriveFile, unshift = false) {
|
|||
}
|
||||
}
|
||||
|
||||
function removeFolder(folderToRemove: firefish.entities.DriveFolder | string) {
|
||||
function removeFolder(folderToRemove: entities.DriveFolder | string) {
|
||||
const folderIdToRemove =
|
||||
typeof folderToRemove === "object" ? folderToRemove.id : folderToRemove;
|
||||
folders.value = folders.value.filter((f) => f.id !== folderIdToRemove);
|
||||
}
|
||||
|
||||
function removeFile(file: firefish.entities.DriveFile | string) {
|
||||
function removeFile(file: entities.DriveFile | string) {
|
||||
const fileId = typeof file === "object" ? file.id : file;
|
||||
files.value = files.value.filter((f) => f.id !== fileId);
|
||||
}
|
||||
|
||||
function appendFile(file: firefish.entities.DriveFile) {
|
||||
function appendFile(file: entities.DriveFile) {
|
||||
addFile(file);
|
||||
}
|
||||
|
||||
function appendFolder(folderToAppend: firefish.entities.DriveFolder) {
|
||||
function appendFolder(folderToAppend: entities.DriveFolder) {
|
||||
addFolder(folderToAppend);
|
||||
}
|
||||
/*
|
||||
function prependFile(file: firefish.entities.DriveFile) {
|
||||
function prependFile(file: entities.DriveFile) {
|
||||
addFile(file, true);
|
||||
}
|
||||
|
||||
function prependFolder(folderToPrepend: firefish.entities.DriveFolder) {
|
||||
function prependFolder(folderToPrepend: entities.DriveFolder) {
|
||||
addFolder(folderToPrepend, true);
|
||||
}
|
||||
*/
|
||||
|
@ -717,9 +704,7 @@ function getMenu() {
|
|||
text: i18n.ts.deleteFolder,
|
||||
icon: `${icon("ph-trash")}`,
|
||||
action: () => {
|
||||
deleteFolder(
|
||||
folder.value as firefish.entities.DriveFolder,
|
||||
);
|
||||
deleteFolder(folder.value as entities.DriveFolder);
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
|
|
|
@ -29,12 +29,12 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { computed } from "vue";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import ImgWithBlurhash from "@/components/MkImgWithBlurhash.vue";
|
||||
import icon from "@/scripts/icon";
|
||||
|
||||
const props = defineProps<{
|
||||
file: firefish.entities.DriveFile;
|
||||
file: entities.DriveFile;
|
||||
fit: string;
|
||||
}>();
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from "vue";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import XDrive from "@/components/MkDrive.vue";
|
||||
import XModalWindow from "@/components/MkModalWindow.vue";
|
||||
import number from "@/filters/number";
|
||||
|
@ -54,13 +54,13 @@ withDefaults(
|
|||
);
|
||||
|
||||
const emit = defineEmits<{
|
||||
(ev: "done", r?: firefish.entities.DriveFile[]): void;
|
||||
(ev: "done", r?: entities.DriveFile[]): void;
|
||||
(ev: "closed"): void;
|
||||
}>();
|
||||
|
||||
const dialog = ref<InstanceType<typeof XModalWindow>>();
|
||||
|
||||
const selected = ref<firefish.entities.DriveFile[]>([]);
|
||||
const selected = ref<entities.DriveFile[]>([]);
|
||||
|
||||
function ok() {
|
||||
emit("done", selected.value);
|
||||
|
@ -72,7 +72,7 @@ function cancel() {
|
|||
dialog.value?.close();
|
||||
}
|
||||
|
||||
function onChangeSelection(files: firefish.entities.DriveFile[]) {
|
||||
function onChangeSelection(files: entities.DriveFile[]) {
|
||||
selected.value = files;
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -14,14 +14,13 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import {} from "vue";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import XDrive from "@/components/MkDrive.vue";
|
||||
import XWindow from "@/components/MkWindow.vue";
|
||||
import { i18n } from "@/i18n";
|
||||
|
||||
defineProps<{
|
||||
initialFolder?: firefish.entities.DriveFolder;
|
||||
initialFolder?: entities.DriveFolder;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
|
|
|
@ -165,7 +165,7 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { computed, onMounted, ref, watch } from "vue";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import { FocusTrap } from "focus-trap-vue";
|
||||
import XSection from "@/components/MkEmojiPicker.section.vue";
|
||||
import type { UnicodeEmojiDef } from "@/scripts/emojilist";
|
||||
|
@ -242,7 +242,7 @@ const height = computed(() =>
|
|||
const customEmojiCategories = emojiCategories;
|
||||
const customEmojis = instance.emojis;
|
||||
const q = ref<string | null>(null);
|
||||
const searchResultCustom = ref<firefish.entities.CustomEmoji[]>([]);
|
||||
const searchResultCustom = ref<entities.CustomEmoji[]>([]);
|
||||
const searchResultUnicode = ref<UnicodeEmojiDef[]>([]);
|
||||
const tab = ref<"index" | "custom" | "unicode" | "tags">("index");
|
||||
|
||||
|
@ -260,7 +260,7 @@ watch(q, () => {
|
|||
const searchCustom = () => {
|
||||
const max = 100;
|
||||
const emojis = customEmojis;
|
||||
const matches = new Set<firefish.entities.CustomEmoji>();
|
||||
const matches = new Set<entities.CustomEmoji>();
|
||||
|
||||
const exactMatch = emojis.find((emoji) => emoji.name === newQ);
|
||||
if (exactMatch) matches.add(exactMatch);
|
||||
|
@ -421,7 +421,7 @@ function reset() {
|
|||
}
|
||||
|
||||
function getKey(
|
||||
emoji: string | firefish.entities.CustomEmoji | UnicodeEmojiDef,
|
||||
emoji: string | entities.CustomEmoji | UnicodeEmojiDef,
|
||||
): string {
|
||||
return typeof emoji === "string" ? emoji : emoji.emoji || `:${emoji.name}:`;
|
||||
}
|
||||
|
|
|
@ -8,10 +8,10 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from "vue";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import * as os from "@/os";
|
||||
|
||||
const meta = ref<firefish.entities.DetailedInstanceMetadata>();
|
||||
const meta = ref<entities.DetailedInstanceMetadata>();
|
||||
|
||||
os.api("meta", { detail: true }).then((gotMeta) => {
|
||||
meta.value = gotMeta;
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
`${file.type}\n${bytes(file.size)}\n${new Date(
|
||||
file.createdAt,
|
||||
).toLocaleString()}\nby ${
|
||||
file.user ? '@' + Acct.toString(file.user) : 'system'
|
||||
file.user ? '@' + acct.toString(file.user) : 'system'
|
||||
}`
|
||||
"
|
||||
:to="`/admin/file/${file.id}`"
|
||||
|
@ -52,13 +52,13 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import * as Acct from "firefish-js/built/acct";
|
||||
import { acct } from "firefish-js";
|
||||
import MkPagination from "@/components/MkPagination.vue";
|
||||
import MkDriveFileThumbnail from "@/components/MkDriveFileThumbnail.vue";
|
||||
import bytes from "@/filters/bytes";
|
||||
import { i18n } from "@/i18n";
|
||||
|
||||
const props = defineProps<{
|
||||
defineProps<{
|
||||
pagination: any;
|
||||
viewMode: "grid" | "list";
|
||||
}>();
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { computed, onBeforeUnmount, onMounted, ref } from "vue";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import * as os from "@/os";
|
||||
import { stream } from "@/stream";
|
||||
import { i18n } from "@/i18n";
|
||||
|
@ -77,7 +77,7 @@ const router = useRouter();
|
|||
const emit = defineEmits(["refresh"]);
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
user: firefish.entities.UserDetailed;
|
||||
user: entities.UserDetailed;
|
||||
full?: boolean;
|
||||
large?: boolean;
|
||||
hideMenu?: boolean;
|
||||
|
@ -108,7 +108,7 @@ if (props.user.isFollowing == null) {
|
|||
}).then(onFollowChange);
|
||||
}
|
||||
|
||||
function onFollowChange(user: firefish.entities.UserDetailed) {
|
||||
function onFollowChange(user: entities.UserDetailed) {
|
||||
if (user.id === props.user.id) {
|
||||
isFollowing.value = user.isFollowing;
|
||||
hasPendingFollowRequestFromYou.value =
|
||||
|
|
|
@ -28,14 +28,14 @@
|
|||
<script lang="ts" setup>
|
||||
import { ref } from "vue";
|
||||
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import bytes from "@/filters/bytes";
|
||||
import number from "@/filters/number";
|
||||
import MkModal from "@/components/MkModal.vue";
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
image: firefish.entities.DriveFile;
|
||||
image: entities.DriveFile;
|
||||
}>(),
|
||||
{},
|
||||
);
|
||||
|
|
|
@ -26,13 +26,13 @@
|
|||
<script lang="ts" setup>
|
||||
import { ref } from "vue";
|
||||
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import MkMiniChart from "@/components/MkMiniChart.vue";
|
||||
import * as os from "@/os";
|
||||
import { getProxiedImageUrlNullable } from "@/scripts/media-proxy";
|
||||
|
||||
const props = defineProps<{
|
||||
instance: firefish.entities.Instance;
|
||||
instance: entities.Instance;
|
||||
}>();
|
||||
|
||||
const chartValues = ref<number[] | null>(null);
|
||||
|
|
|
@ -58,21 +58,21 @@
|
|||
<script lang="ts" setup>
|
||||
import { ref } from "vue";
|
||||
|
||||
import type { Instance } from "firefish-js/built/entities";
|
||||
import type { entities } from "firefish-js";
|
||||
import MkInput from "@/components/form/input.vue";
|
||||
import XModalWindow from "@/components/MkModalWindow.vue";
|
||||
import * as os from "@/os";
|
||||
import { i18n } from "@/i18n";
|
||||
|
||||
const emit = defineEmits<{
|
||||
(ev: "ok", selected: Instance): void;
|
||||
(ev: "ok", selected: entities.Instance): void;
|
||||
(ev: "cancel"): void;
|
||||
(ev: "closed"): void;
|
||||
}>();
|
||||
|
||||
const hostname = ref("");
|
||||
const instances: Instance[] = ref([]);
|
||||
const selected: Instance | null = ref(null);
|
||||
const instances = ref<entities.Instance[]>([]);
|
||||
const selected = ref<entities.Instance | null>();
|
||||
const dialogEl = ref<InstanceType<typeof XModalWindow>>();
|
||||
|
||||
let searchOrderLatch = 0;
|
||||
|
@ -97,7 +97,7 @@ const search = () => {
|
|||
id: x.id,
|
||||
host: x.host,
|
||||
iconUrl: x.iconUrl,
|
||||
}) as Instance,
|
||||
}) as entities.Instance,
|
||||
);
|
||||
});
|
||||
};
|
||||
|
|
|
@ -92,7 +92,7 @@
|
|||
import { computed, ref, watch } from "vue";
|
||||
import VuePlyr from "vue-plyr";
|
||||
import "vue-plyr/dist/vue-plyr.css";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import { getStaticImageUrl } from "@/scripts/get-static-image-url";
|
||||
import ImgWithBlurhash from "@/components/MkImgWithBlurhash.vue";
|
||||
import { defaultStore } from "@/store";
|
||||
|
@ -101,7 +101,7 @@ import * as os from "@/os";
|
|||
import icon from "@/scripts/icon";
|
||||
|
||||
const props = defineProps<{
|
||||
media: firefish.entities.DriveFile;
|
||||
media: entities.DriveFile;
|
||||
raw?: boolean;
|
||||
}>();
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
<script lang="ts" setup>
|
||||
import { onMounted, ref } from "vue";
|
||||
import VuePlyr from "vue-plyr";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import { ColdDeviceStorage } from "@/store";
|
||||
import "vue-plyr/dist/vue-plyr.css";
|
||||
import { i18n } from "@/i18n";
|
||||
|
@ -66,7 +66,7 @@ import icon from "@/scripts/icon";
|
|||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
media: firefish.entities.DriveFile;
|
||||
media: entities.DriveFile;
|
||||
}>(),
|
||||
{},
|
||||
);
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, ref } from "vue";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import PhotoSwipeLightbox from "photoswipe/lightbox";
|
||||
import PhotoSwipe from "photoswipe";
|
||||
import "photoswipe/style.css";
|
||||
|
@ -56,7 +56,7 @@ import {
|
|||
} from "@/const";
|
||||
|
||||
const props = defineProps<{
|
||||
mediaList: firefish.entities.DriveFile[];
|
||||
mediaList: entities.DriveFile[];
|
||||
raw?: boolean;
|
||||
inDm?: boolean;
|
||||
}>();
|
||||
|
@ -184,7 +184,7 @@ onMounted(() => {
|
|||
}
|
||||
});
|
||||
|
||||
const previewable = (file: firefish.entities.DriveFile): boolean => {
|
||||
const previewable = (file: entities.DriveFile): boolean => {
|
||||
if (file.type === "image/svg+xml") return true; // svgのwebpublic/thumbnailはpngなのでtrue
|
||||
// FILE_TYPE_BROWSERSAFEに適合しないものはブラウザで表示するのに不適切
|
||||
if (isModule(file)) return true;
|
||||
|
@ -194,7 +194,7 @@ const previewable = (file: firefish.entities.DriveFile): boolean => {
|
|||
);
|
||||
};
|
||||
|
||||
const isModule = (file: firefish.entities.DriveFile): boolean => {
|
||||
const isModule = (file: entities.DriveFile): boolean => {
|
||||
return (
|
||||
FILE_TYPE_TRACKER_MODULES.includes(file.type) ||
|
||||
FILE_EXT_TRACKER_MODULES.some((ext) => {
|
||||
|
|
|
@ -107,7 +107,7 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { nextTick, onDeactivated, onMounted, ref, shallowRef } from "vue";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import FormRange from "./form/range.vue";
|
||||
import { i18n } from "@/i18n";
|
||||
import * as os from "@/os";
|
||||
|
@ -116,7 +116,7 @@ import { ChiptuneJsConfig, ChiptuneJsPlayer } from "@/scripts/chiptune2";
|
|||
import icon from "@/scripts/icon";
|
||||
|
||||
const props = defineProps<{
|
||||
module: firefish.entities.DriveFile;
|
||||
module: entities.DriveFile;
|
||||
}>();
|
||||
|
||||
interface ModRow {
|
||||
|
|
|
@ -273,7 +273,7 @@
|
|||
<script lang="ts" setup>
|
||||
import { computed, inject, onMounted, ref } from "vue";
|
||||
import type { Ref } from "vue";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import MkSubNoteContent from "./MkSubNoteContent.vue";
|
||||
import MkNoteSub from "@/components/MkNoteSub.vue";
|
||||
import XNoteHeader from "@/components/MkNoteHeader.vue";
|
||||
|
@ -306,7 +306,7 @@ import icon from "@/scripts/icon";
|
|||
const router = useRouter();
|
||||
|
||||
const props = defineProps<{
|
||||
note: firefish.entities.Note;
|
||||
note: entities.Note;
|
||||
pinned?: boolean;
|
||||
detailedView?: boolean;
|
||||
collapsedReply?: boolean;
|
||||
|
@ -351,7 +351,7 @@ const renoteButton = ref<InstanceType<typeof XRenoteButton>>();
|
|||
const renoteTime = ref<HTMLElement>();
|
||||
const reactButton = ref<HTMLElement>();
|
||||
const appearNote = computed(() =>
|
||||
isRenote ? (note.value.renote as firefish.entities.Note) : note.value,
|
||||
isRenote ? (note.value.renote as entities.Note) : note.value,
|
||||
);
|
||||
const isMyRenote = isSignedIn && $i.id === note.value.userId;
|
||||
const showContent = ref(false);
|
||||
|
@ -466,7 +466,7 @@ function undoReact(note): void {
|
|||
});
|
||||
}
|
||||
|
||||
const currentClipPage = inject<Ref<firefish.entities.Clip> | null>(
|
||||
const currentClipPage = inject<Ref<entities.Clip> | null>(
|
||||
"currentClipPage",
|
||||
null,
|
||||
);
|
||||
|
|
|
@ -168,8 +168,7 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, onUnmounted, onUpdated, ref } from "vue";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { NoteUpdatedEvent } from "firefish-js/built/streaming.types";
|
||||
import type { entities, StreamTypes } from "firefish-js";
|
||||
import MkTab from "@/components/MkTab.vue";
|
||||
import MkNote from "@/components/MkNote.vue";
|
||||
import MkNoteSub from "@/components/MkNoteSub.vue";
|
||||
|
@ -191,7 +190,7 @@ import { stream } from "@/stream";
|
|||
// import icon from "@/scripts/icon";
|
||||
|
||||
const props = defineProps<{
|
||||
note: firefish.entities.Note;
|
||||
note: entities.Note;
|
||||
pinned?: boolean;
|
||||
}>();
|
||||
|
||||
|
@ -242,10 +241,10 @@ const muted = ref(
|
|||
);
|
||||
const translation = ref(null);
|
||||
const translating = ref(false);
|
||||
const conversation = ref<null | firefish.entities.Note[]>([]);
|
||||
const replies = ref<firefish.entities.Note[]>([]);
|
||||
const directReplies = ref<null | firefish.entities.Note[]>([]);
|
||||
const directQuotes = ref<null | firefish.entities.Note[]>([]);
|
||||
const conversation = ref<null | entities.Note[]>([]);
|
||||
const replies = ref<entities.Note[]>([]);
|
||||
const directReplies = ref<null | entities.Note[]>([]);
|
||||
const directQuotes = ref<null | entities.Note[]>([]);
|
||||
const clips = ref();
|
||||
const renotes = ref();
|
||||
let isScrolling;
|
||||
|
@ -415,7 +414,9 @@ function loadTab() {
|
|||
}
|
||||
}
|
||||
|
||||
async function onNoteUpdated(noteData: NoteUpdatedEvent): Promise<void> {
|
||||
async function onNoteUpdated(
|
||||
noteData: StreamTypes.NoteUpdatedEvent,
|
||||
): Promise<void> {
|
||||
const { type, id, body } = noteData;
|
||||
|
||||
let found = -1;
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
<script lang="ts" setup>
|
||||
import { ref } from "vue";
|
||||
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import { defaultStore } from "@/store";
|
||||
import MkVisibility from "@/components/MkVisibility.vue";
|
||||
import MkInstanceTicker from "@/components/MkInstanceTicker.vue";
|
||||
|
@ -61,7 +61,7 @@ import { pageWindow } from "@/os";
|
|||
import icon from "@/scripts/icon";
|
||||
|
||||
const props = defineProps<{
|
||||
note: firefish.entities.Note;
|
||||
note: entities.Note;
|
||||
pinned?: boolean;
|
||||
canOpenServerInfo?: boolean;
|
||||
}>();
|
||||
|
|
|
@ -11,12 +11,12 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import XNoteHeader from "@/components/MkNoteHeader.vue";
|
||||
import MkSubNoteContent from "@/components/MkSubNoteContent.vue";
|
||||
|
||||
defineProps<{
|
||||
note: firefish.entities.Note;
|
||||
note: entities.Note;
|
||||
pinned?: boolean;
|
||||
}>();
|
||||
</script>
|
||||
|
|
|
@ -191,7 +191,7 @@
|
|||
<script lang="ts" setup>
|
||||
import { computed, inject, ref } from "vue";
|
||||
import type { Ref } from "vue";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import XNoteHeader from "@/components/MkNoteHeader.vue";
|
||||
import MkSubNoteContent from "@/components/MkSubNoteContent.vue";
|
||||
import XReactionsViewer from "@/components/MkReactionsViewer.vue";
|
||||
|
@ -221,8 +221,8 @@ const router = useRouter();
|
|||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
note: firefish.entities.Note;
|
||||
conversation?: firefish.entities.Note[];
|
||||
note: entities.Note;
|
||||
conversation?: entities.Note[];
|
||||
parentId?;
|
||||
detailedView?;
|
||||
|
||||
|
@ -262,7 +262,7 @@ const starButton = ref<InstanceType<typeof XStarButton>>();
|
|||
const renoteButton = ref<InstanceType<typeof XRenoteButton>>();
|
||||
const reactButton = ref<HTMLElement>();
|
||||
const appearNote = computed(() =>
|
||||
isRenote ? (note.value.renote as firefish.entities.Note) : note.value,
|
||||
isRenote ? (note.value.renote as entities.Note) : note.value,
|
||||
);
|
||||
const isDeleted = ref(false);
|
||||
const muted = ref(
|
||||
|
@ -275,7 +275,7 @@ const muted = ref(
|
|||
);
|
||||
const translation = ref(null);
|
||||
const translating = ref(false);
|
||||
const replies: firefish.entities.Note[] =
|
||||
const replies: entities.Note[] =
|
||||
props.conversation
|
||||
?.filter(
|
||||
(item) =>
|
||||
|
@ -369,7 +369,7 @@ function undoReact(note): void {
|
|||
});
|
||||
}
|
||||
|
||||
const currentClipPage = inject<Ref<firefish.entities.Clip> | null>(
|
||||
const currentClipPage = inject<Ref<entities.Clip> | null>(
|
||||
"currentClipPage",
|
||||
null,
|
||||
);
|
||||
|
|
|
@ -274,7 +274,7 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, onUnmounted, ref, watch } from "vue";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import XReactionIcon from "@/components/MkReactionIcon.vue";
|
||||
import MkFollowButton from "@/components/MkFollowButton.vue";
|
||||
import XReactionTooltip from "@/components/MkReactionTooltip.vue";
|
||||
|
@ -291,7 +291,7 @@ import icon from "@/scripts/icon";
|
|||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
notification: firefish.entities.Notification;
|
||||
notification: entities.Notification;
|
||||
withTime?: boolean;
|
||||
full?: boolean;
|
||||
}>(),
|
||||
|
|
|
@ -69,7 +69,7 @@
|
|||
<script lang="ts" setup>
|
||||
import type { ComputedRef } from "vue";
|
||||
import { computed, isRef, onActivated, onDeactivated, ref, watch } from "vue";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { Endpoints } from "firefish-js";
|
||||
import * as os from "@/os";
|
||||
import {
|
||||
getScrollContainer,
|
||||
|
@ -81,14 +81,10 @@ import MkButton from "@/components/MkButton.vue";
|
|||
import { i18n } from "@/i18n";
|
||||
import { defaultStore } from "@/store";
|
||||
|
||||
export interface Paging<
|
||||
E extends keyof firefish.Endpoints = keyof firefish.Endpoints,
|
||||
> {
|
||||
export interface Paging<E extends keyof Endpoints = keyof Endpoints> {
|
||||
endpoint: E;
|
||||
limit: number;
|
||||
params?:
|
||||
| firefish.Endpoints[E]["req"]
|
||||
| ComputedRef<firefish.Endpoints[E]["req"]>;
|
||||
params?: Endpoints[E]["req"] | ComputedRef<Endpoints[E]["req"]>;
|
||||
|
||||
/**
|
||||
* 検索APIのような、ページング不可なエンドポイントを利用する場合
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref } from "vue";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import { sum } from "@/scripts/array";
|
||||
import { pleaseLogin } from "@/scripts/please-login";
|
||||
import * as os from "@/os";
|
||||
|
@ -62,7 +62,7 @@ import { useInterval } from "@/scripts/use-interval";
|
|||
import icon from "@/scripts/icon";
|
||||
|
||||
const props = defineProps<{
|
||||
note: firefish.entities.Note;
|
||||
note: entities.Note;
|
||||
readOnly?: boolean;
|
||||
}>();
|
||||
|
||||
|
|
|
@ -260,12 +260,11 @@ import {
|
|||
watch,
|
||||
} from "vue";
|
||||
import * as mfm from "mfm-js";
|
||||
import type * as firefish from "firefish-js";
|
||||
import autosize from "autosize";
|
||||
import insertTextAtCursor from "insert-text-at-cursor";
|
||||
import { length } from "stringz";
|
||||
import { toASCII } from "punycode/";
|
||||
import * as Acct from "firefish-js/built/acct";
|
||||
import { acct, noteVisibilities, languages, type entities } from "firefish-js";
|
||||
import { throttle } from "throttle-debounce";
|
||||
import XNoteSimple from "@/components/MkNoteSimple.vue";
|
||||
import XNotePreview from "@/components/MkNotePreview.vue";
|
||||
|
@ -299,23 +298,23 @@ const modal = inject("modal");
|
|||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
reply?: firefish.entities.Note;
|
||||
renote?: firefish.entities.Note;
|
||||
reply?: entities.Note;
|
||||
renote?: entities.Note;
|
||||
channel?: any; // TODO
|
||||
mention?: firefish.entities.User;
|
||||
specified?: firefish.entities.User;
|
||||
mention?: entities.User;
|
||||
specified?: entities.User;
|
||||
initialText?: string;
|
||||
initialVisibility?: typeof firefish.noteVisibilities;
|
||||
initialLanguage?: typeof firefish.languages;
|
||||
initialFiles?: firefish.entities.DriveFile[];
|
||||
initialVisibility?: typeof noteVisibilities;
|
||||
initialLanguage?: typeof languages;
|
||||
initialFiles?: entities.DriveFile[];
|
||||
initialLocalOnly?: boolean;
|
||||
initialVisibleUsers?: firefish.entities.User[];
|
||||
initialNote?: firefish.entities.Note;
|
||||
initialVisibleUsers?: entities.User[];
|
||||
initialNote?: entities.Note;
|
||||
instant?: boolean;
|
||||
fixed?: boolean;
|
||||
autofocus?: boolean;
|
||||
showMfmCheatSheet?: boolean;
|
||||
editId?: firefish.entities.Note["id"];
|
||||
editId?: entities.Note["id"];
|
||||
}>(),
|
||||
{
|
||||
initialVisibleUsers: () => [],
|
||||
|
@ -358,7 +357,7 @@ const visibility = ref(
|
|||
((defaultStore.state.rememberNoteVisibility
|
||||
? defaultStore.state.visibility
|
||||
: defaultStore.state
|
||||
.defaultNoteVisibility) as (typeof firefish.noteVisibilities)[number]),
|
||||
.defaultNoteVisibility) as (typeof noteVisibilities)[number]),
|
||||
);
|
||||
|
||||
const visibleUsers = ref([]);
|
||||
|
@ -1090,7 +1089,7 @@ function cancel() {
|
|||
|
||||
function insertMention() {
|
||||
os.selectUser().then((user) => {
|
||||
insertTextAtCursor(textareaEl.value, "@" + Acct.toString(user) + " ");
|
||||
insertTextAtCursor(textareaEl.value, "@" + acct.toString(user) + " ");
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -1123,7 +1122,7 @@ function showActions(ev) {
|
|||
);
|
||||
}
|
||||
|
||||
const postAccount = ref<firefish.entities.UserDetailed | null>(null);
|
||||
const postAccount = ref<entities.UserDetailed | null>(null);
|
||||
|
||||
function openAccountMenu(ev: MouseEvent) {
|
||||
openAccountMenu_(
|
||||
|
|
|
@ -21,27 +21,27 @@
|
|||
<script lang="ts" setup>
|
||||
import { shallowRef } from "vue";
|
||||
|
||||
import type * as firefish from "firefish-js";
|
||||
import { noteVisibilities, languages, type entities } from "firefish-js";
|
||||
import MkModal from "@/components/MkModal.vue";
|
||||
import MkPostForm from "@/components/MkPostForm.vue";
|
||||
|
||||
const props = defineProps<{
|
||||
reply?: firefish.entities.Note;
|
||||
renote?: firefish.entities.Note;
|
||||
reply?: entities.Note;
|
||||
renote?: entities.Note;
|
||||
channel?: any; // TODO
|
||||
mention?: firefish.entities.User;
|
||||
specified?: firefish.entities.User;
|
||||
mention?: entities.User;
|
||||
specified?: entities.User;
|
||||
initialText?: string;
|
||||
initialVisibility?: typeof firefish.noteVisibilities;
|
||||
initialLanguage?: typeof firefish.languages;
|
||||
initialFiles?: firefish.entities.DriveFile[];
|
||||
initialVisibility?: typeof noteVisibilities;
|
||||
initialLanguage?: typeof languages;
|
||||
initialFiles?: entities.DriveFile[];
|
||||
initialLocalOnly?: boolean;
|
||||
initialVisibleUsers?: firefish.entities.User[];
|
||||
initialNote?: firefish.entities.Note;
|
||||
initialVisibleUsers?: entities.User[];
|
||||
initialNote?: entities.Note;
|
||||
instant?: boolean;
|
||||
fixed?: boolean;
|
||||
autofocus?: boolean;
|
||||
editId?: firefish.entities.Note["id"];
|
||||
editId?: entities.Note["id"];
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { computed } from "vue";
|
||||
import type { Note } from "firefish-js/built/entities";
|
||||
import type { entities } from "firefish-js";
|
||||
import { pleaseLogin } from "@/scripts/please-login";
|
||||
import * as os from "@/os";
|
||||
import { $i } from "@/reactiveAccount";
|
||||
|
@ -20,7 +20,7 @@ import { defaultStore } from "@/store";
|
|||
import icon from "@/scripts/icon";
|
||||
|
||||
const props = defineProps<{
|
||||
note: Note;
|
||||
note: entities.Note;
|
||||
}>();
|
||||
|
||||
const canRenote = computed(
|
||||
|
|
|
@ -37,16 +37,16 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, ref, watch } from "vue";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import MkReactionIcon from "@/components/MkReactionIcon.vue";
|
||||
import MkUserCardMini from "@/components/MkUserCardMini.vue";
|
||||
import * as os from "@/os";
|
||||
|
||||
const props = defineProps<{
|
||||
noteId: firefish.entities.Note["id"];
|
||||
noteId: entities.Note["id"];
|
||||
}>();
|
||||
|
||||
const note = ref<firefish.entities.Note>();
|
||||
const note = ref<entities.Note>();
|
||||
const tab = ref<string | null>(null);
|
||||
const reactions = ref<string[]>();
|
||||
const users = ref();
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref } from "vue";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entitites } from "firefish-js";
|
||||
import XDetails from "@/components/MkReactionsViewer.details.vue";
|
||||
import XReactionIcon from "@/components/MkReactionIcon.vue";
|
||||
import * as os from "@/os";
|
||||
|
@ -34,7 +34,7 @@ const props = defineProps<{
|
|||
reaction: string;
|
||||
count: number;
|
||||
isInitial: boolean;
|
||||
note: firefish.entities.Note;
|
||||
note: entities.Note;
|
||||
}>();
|
||||
|
||||
const emit = defineEmits<{
|
||||
|
|
|
@ -18,12 +18,12 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref } from "vue";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import { $i, isSignedIn } from "@/reactiveAccount";
|
||||
import XReaction from "@/components/MkReactionsViewer.reaction.vue";
|
||||
|
||||
const props = defineProps<{
|
||||
note: firefish.entities.Note;
|
||||
note: entities.Note;
|
||||
}>();
|
||||
|
||||
const reactionsEl = ref<HTMLElement>();
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref } from "vue";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import Ripple from "@/components/MkRipple.vue";
|
||||
import XDetails from "@/components/MkUsersTooltip.vue";
|
||||
import { pleaseLogin } from "@/scripts/please-login";
|
||||
|
@ -36,7 +36,7 @@ import { vibrate } from "@/scripts/vibrate";
|
|||
import icon from "@/scripts/icon";
|
||||
|
||||
const props = defineProps<{
|
||||
note: firefish.entities.Note;
|
||||
note: entities.Note;
|
||||
count: number;
|
||||
detailedView?;
|
||||
}>();
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import type { Note } from "firefish-js/built/entities";
|
||||
import type { entities } from "firefish-js";
|
||||
import Ripple from "@/components/MkRipple.vue";
|
||||
import { pleaseLogin } from "@/scripts/please-login";
|
||||
import * as os from "@/os";
|
||||
|
@ -52,7 +52,7 @@ import { instance } from "@/instance";
|
|||
import icon from "@/scripts/icon";
|
||||
|
||||
const props = defineProps<{
|
||||
note: Note;
|
||||
note: entities.Note;
|
||||
}>();
|
||||
|
||||
function star(ev?: MouseEvent): void {
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from "vue";
|
||||
import type { Note } from "firefish-js/built/entities";
|
||||
import type { entities } from "firefish-js";
|
||||
import Ripple from "@/components/MkRipple.vue";
|
||||
import XDetails from "@/components/MkUsersTooltip.vue";
|
||||
import { pleaseLogin } from "@/scripts/please-login";
|
||||
|
@ -50,7 +50,7 @@ import { useTooltip } from "@/scripts/use-tooltip";
|
|||
import icon from "@/scripts/icon";
|
||||
|
||||
const props = defineProps<{
|
||||
note: Note;
|
||||
note: entities.Note;
|
||||
count: number;
|
||||
reacted: boolean;
|
||||
}>();
|
||||
|
|
|
@ -179,7 +179,7 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from "vue";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import * as mfm from "mfm-js";
|
||||
import * as os from "@/os";
|
||||
import XNoteSimple from "@/components/MkNoteSimple.vue";
|
||||
|
@ -197,7 +197,7 @@ import { defaultStore } from "@/store";
|
|||
import icon from "@/scripts/icon";
|
||||
|
||||
const props = defineProps<{
|
||||
note: firefish.entities.Note;
|
||||
note: entities.Note;
|
||||
parentId?;
|
||||
conversation?;
|
||||
detailed?: boolean;
|
||||
|
|
|
@ -16,7 +16,9 @@
|
|||
<div class="body">
|
||||
<span class="name"><MkUserName class="name" :user="user" /></span>
|
||||
<span class="sub"
|
||||
><span class="acct _monospace">@{{ acct(user) }}</span></span
|
||||
><span class="acct _monospace"
|
||||
>@{{ acct.toString(user) }}</span
|
||||
></span
|
||||
>
|
||||
</div>
|
||||
<MkMiniChart v-if="chartValues" class="chart" :src="chartValues" />
|
||||
|
@ -26,14 +28,14 @@
|
|||
<script lang="ts" setup>
|
||||
import { ref } from "vue";
|
||||
|
||||
import type * as firefish from "firefish-js";
|
||||
import { acct, type entities } from "firefish-js";
|
||||
import MkMiniChart from "@/components/MkMiniChart.vue";
|
||||
import * as os from "@/os";
|
||||
import { acct, userPage } from "@/filters/user";
|
||||
import { userPage } from "@/filters/user";
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
user: firefish.entities.User;
|
||||
user: entities.User;
|
||||
withChart?: boolean;
|
||||
showAboutPage?: boolean;
|
||||
}>(),
|
||||
|
|
|
@ -91,7 +91,7 @@
|
|||
<script lang="ts" setup>
|
||||
import { ref } from "vue";
|
||||
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import MkFollowButton from "@/components/MkFollowButton.vue";
|
||||
import XShowMoreButton from "@/components/MkShowMoreButton.vue";
|
||||
import MkNumber from "@/components/MkNumber.vue";
|
||||
|
@ -100,7 +100,7 @@ import { i18n } from "@/i18n";
|
|||
import { $i, isSignedIn } from "@/reactiveAccount";
|
||||
|
||||
const props = defineProps<{
|
||||
user: firefish.entities.UserDetailed;
|
||||
user: entities.UserDetailed;
|
||||
detailed?: boolean;
|
||||
}>();
|
||||
|
||||
|
|
|
@ -5,11 +5,11 @@
|
|||
<script lang="ts" setup>
|
||||
import { computed } from "vue";
|
||||
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import { i18n } from "@/i18n";
|
||||
|
||||
const props = defineProps<{
|
||||
user: firefish.entities.User;
|
||||
user: entities.User;
|
||||
}>();
|
||||
|
||||
const text = computed(() => {
|
||||
|
|
|
@ -29,8 +29,7 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, ref } from "vue";
|
||||
import * as Acct from "firefish-js/built/acct";
|
||||
import type * as firefish from "firefish-js";
|
||||
import { acct, type entities } from "firefish-js";
|
||||
import MkUserInfo from "@/components/MkUserInfo.vue";
|
||||
import * as os from "@/os";
|
||||
import { defaultStore } from "@/store";
|
||||
|
@ -48,7 +47,7 @@ const emit = defineEmits<{
|
|||
}>();
|
||||
|
||||
const zIndex = os.claimZIndex("middle");
|
||||
const user = ref<firefish.entities.UserDetailed | null>(null);
|
||||
const user = ref<entities.UserDetailed | null>(null);
|
||||
const top = ref(0);
|
||||
const left = ref(0);
|
||||
|
||||
|
@ -57,7 +56,7 @@ onMounted(() => {
|
|||
user.value = props.q;
|
||||
} else {
|
||||
const query = props.q.startsWith("@")
|
||||
? Acct.parse(props.q.slice(1))
|
||||
? acct.parse(props.q.slice(1))
|
||||
: { userId: props.q };
|
||||
|
||||
os.api("users/show", query).then((res) => {
|
||||
|
|
|
@ -89,7 +89,7 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, ref } from "vue";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import MkInput from "@/components/form/input.vue";
|
||||
import FormSplit from "@/components/form/split.vue";
|
||||
import XModalWindow from "@/components/MkModalWindow.vue";
|
||||
|
@ -98,16 +98,16 @@ import { defaultStore } from "@/store";
|
|||
import { i18n } from "@/i18n";
|
||||
|
||||
const emit = defineEmits<{
|
||||
(ev: "ok", selected: firefish.entities.UserDetailed): void;
|
||||
(ev: "ok", selected: entities.UserDetailed): void;
|
||||
(ev: "cancel"): void;
|
||||
(ev: "closed"): void;
|
||||
}>();
|
||||
|
||||
const username = ref("");
|
||||
const host = ref("");
|
||||
const users: firefish.entities.UserDetailed[] = ref([]);
|
||||
const recentUsers: firefish.entities.UserDetailed[] = ref([]);
|
||||
const selected: firefish.entities.UserDetailed | null = ref(null);
|
||||
const users: entities.UserDetailed[] = ref([]);
|
||||
const recentUsers: entities.UserDetailed[] = ref([]);
|
||||
const selected: entities.UserDetailed | null = ref(null);
|
||||
const dialogEl = ref();
|
||||
|
||||
const search = () => {
|
||||
|
|
|
@ -85,7 +85,7 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, ref } from "vue";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import MkInput from "@/components/form/input.vue";
|
||||
import FormSplit from "@/components/form/split.vue";
|
||||
import XModalWindow from "@/components/MkModalWindow.vue";
|
||||
|
@ -94,15 +94,15 @@ import { defaultStore } from "@/store";
|
|||
import { i18n } from "@/i18n";
|
||||
|
||||
const emit = defineEmits<{
|
||||
(ev: "ok", selected: firefish.entities.UserDetailed): void;
|
||||
(ev: "ok", selected: entities.UserDetailed): void;
|
||||
(ev: "cancel"): void;
|
||||
(ev: "closed"): void;
|
||||
}>();
|
||||
|
||||
const username = ref("");
|
||||
const users: firefish.entities.UserDetailed[] = ref([]);
|
||||
const recentUsers: firefish.entities.UserDetailed[] = ref([]);
|
||||
const selected: firefish.entities.UserDetailed | null = ref(null);
|
||||
const users = ref([] as entities.UserDetailed[]);
|
||||
const recentUsers = ref([] as entities.UserDetailed[]);
|
||||
const selected = ref<entities.UserDetailed | null>(null);
|
||||
const dialogEl = ref();
|
||||
|
||||
const search = () => {
|
||||
|
|
|
@ -125,7 +125,7 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { nextTick, ref, shallowRef, watch } from "vue";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { noteVisibilities } from "firefish-js";
|
||||
import MkModal from "@/components/MkModal.vue";
|
||||
import { i18n } from "@/i18n";
|
||||
import icon from "@/scripts/icon";
|
||||
|
@ -134,7 +134,7 @@ const modal = shallowRef<InstanceType<typeof MkModal>>();
|
|||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
currentVisibility: (typeof firefish.noteVisibilities)[number];
|
||||
currentVisibility: (typeof noteVisibilities)[number];
|
||||
currentLocalOnly: boolean;
|
||||
src?: HTMLElement;
|
||||
}>(),
|
||||
|
@ -142,10 +142,7 @@ const props = withDefaults(
|
|||
);
|
||||
|
||||
const emit = defineEmits<{
|
||||
(
|
||||
ev: "changeVisibility",
|
||||
v: (typeof firefish.noteVisibilities)[number],
|
||||
): void;
|
||||
(ev: "changeVisibility", v: (typeof noteVisibilities)[number]): void;
|
||||
(ev: "changeLocalOnly", v: boolean): void;
|
||||
(ev: "closed"): void;
|
||||
}>();
|
||||
|
@ -157,7 +154,7 @@ watch(localOnly, () => {
|
|||
emit("changeLocalOnly", localOnly.value);
|
||||
});
|
||||
|
||||
function choose(visibility: (typeof firefish.noteVisibilities)[number]): void {
|
||||
function choose(visibility: (typeof noteVisibilities)[number]): void {
|
||||
v.value = visibility;
|
||||
emit("changeVisibility", visibility);
|
||||
nextTick(() => {
|
||||
|
|
|
@ -10,13 +10,13 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import { toUnicode } from "punycode/";
|
||||
import { host as hostRaw } from "@/config";
|
||||
import { defaultStore } from "@/store";
|
||||
|
||||
defineProps<{
|
||||
user: firefish.entities.UserDetailed;
|
||||
user: entities.UserDetailed;
|
||||
detail?: boolean;
|
||||
}>();
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
square: defaultStore.state.squareAvatars,
|
||||
}"
|
||||
:style="{ color }"
|
||||
:title="acct(user)"
|
||||
:title="acct.toString(user)"
|
||||
@click="onClick"
|
||||
>
|
||||
<img class="inner" :src="url" decoding="async" />
|
||||
|
@ -27,7 +27,7 @@
|
|||
square: defaultStore.state.squareAvatars,
|
||||
}"
|
||||
:style="{ color }"
|
||||
:title="acct(user)"
|
||||
:title="acct.toString(user)"
|
||||
ref="gallery"
|
||||
@click.stop
|
||||
>
|
||||
|
@ -48,7 +48,7 @@
|
|||
}"
|
||||
:style="{ color }"
|
||||
:to="userPage(user)"
|
||||
:title="acct(user)"
|
||||
:title="acct.toString(user)"
|
||||
:target="target"
|
||||
@click.stop
|
||||
>
|
||||
|
@ -63,10 +63,10 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { computed, onMounted, ref, watch } from "vue";
|
||||
import type * as firefish from "firefish-js";
|
||||
import { acct, type entities } from "firefish-js";
|
||||
import { getStaticImageUrl } from "@/scripts/get-static-image-url";
|
||||
import { extractAvgColorFromBlurhash } from "@/scripts/extract-avg-color-from-blurhash";
|
||||
import { acct, userPage } from "@/filters/user";
|
||||
import { userPage } from "@/filters/user";
|
||||
import MkUserOnlineIndicator from "@/components/MkUserOnlineIndicator.vue";
|
||||
import { defaultStore } from "@/store";
|
||||
import PhotoSwipeLightbox from "photoswipe/lightbox";
|
||||
|
@ -75,7 +75,7 @@ import "photoswipe/style.css";
|
|||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
user: firefish.entities.User;
|
||||
user: entities.User;
|
||||
target?: string | null;
|
||||
disableLink?: boolean;
|
||||
showLightBox?: boolean;
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { computed } from "vue";
|
||||
import type { CustomEmoji } from "firefish-js/built/entities";
|
||||
import type { entities } from "firefish-js";
|
||||
import { getStaticImageUrl } from "@/scripts/get-static-image-url";
|
||||
import { char2filePath } from "@/scripts/twemoji-base";
|
||||
import { defaultStore } from "@/store";
|
||||
|
@ -32,7 +32,7 @@ const props = defineProps<{
|
|||
emoji: string;
|
||||
normal?: boolean;
|
||||
noStyle?: boolean;
|
||||
customEmojis?: CustomEmoji[];
|
||||
customEmojis?: entities.CustomEmoji[];
|
||||
isReaction?: boolean;
|
||||
}>();
|
||||
|
||||
|
|
|
@ -9,11 +9,11 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
|
||||
const props = withDefaults(
|
||||
withDefaults(
|
||||
defineProps<{
|
||||
user: firefish.entities.User;
|
||||
user: entities.User;
|
||||
nowrap?: boolean;
|
||||
}>(),
|
||||
{
|
||||
|
|
|
@ -1,15 +1,12 @@
|
|||
import type * as firefish from "firefish-js";
|
||||
import * as Acct from "firefish-js/built/acct";
|
||||
import { acct, type Acct, type entities } from "firefish-js";
|
||||
import { url } from "@/config";
|
||||
|
||||
export const acct = (user: firefish.Acct) => {
|
||||
return Acct.toString(user);
|
||||
};
|
||||
|
||||
export const userName = (user: firefish.entities.User) => {
|
||||
export const userName = (user: entities.User) => {
|
||||
return user.name || user.username;
|
||||
};
|
||||
|
||||
export const userPage = (user: firefish.Acct, path?, absolute = false) => {
|
||||
return `${absolute ? url : ""}/@${acct(user)}${path ? `/${path}` : ""}`;
|
||||
export const userPage = (user: Acct, path?, absolute = false) => {
|
||||
return `${absolute ? url : ""}/@${acct.toString(user)}${
|
||||
path ? `/${path}` : ""
|
||||
}`;
|
||||
};
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import { computed, reactive } from "vue";
|
||||
import { api } from "./os";
|
||||
|
||||
|
@ -7,7 +7,7 @@ import { api } from "./os";
|
|||
const instanceData = localStorage.getItem("instance");
|
||||
// TODO: instanceをリアクティブにするかは再考の余地あり
|
||||
|
||||
export const instance: firefish.entities.DetailedInstanceMetadata = reactive(
|
||||
export const instance: entities.DetailedInstanceMetadata = reactive(
|
||||
instanceData
|
||||
? JSON.parse(instanceData)
|
||||
: {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// TODO: なんでもかんでもos.tsに突っ込むのやめたいのでよしなに分割する
|
||||
|
||||
import { EventEmitter } from "eventemitter3";
|
||||
import * as firefish from "firefish-js";
|
||||
import { api as firefishApi, type entities } from "firefish-js";
|
||||
import insertTextAtCursor from "insert-text-at-cursor";
|
||||
import type { Component, Ref } from "vue";
|
||||
import { defineAsyncComponent, markRaw, ref } from "vue";
|
||||
|
@ -16,7 +16,7 @@ import type { MenuItem } from "@/types/menu";
|
|||
|
||||
export const pendingApiRequestsCount = ref(0);
|
||||
|
||||
const apiClient = new firefish.api.APIClient({
|
||||
const apiClient = new firefishApi.APIClient({
|
||||
origin: url,
|
||||
});
|
||||
|
||||
|
@ -655,7 +655,7 @@ export async function selectLocalUser() {
|
|||
});
|
||||
}
|
||||
|
||||
export async function selectInstance(): Promise<firefish.entities.Instance> {
|
||||
export async function selectInstance(): Promise<entities.Instance> {
|
||||
return new Promise((resolve, reject) => {
|
||||
popup(
|
||||
defineAsyncComponent({
|
||||
|
@ -745,11 +745,11 @@ export async function pickEmoji(src: HTMLElement | null, opts) {
|
|||
}
|
||||
|
||||
export async function cropImage(
|
||||
image: firefish.entities.DriveFile,
|
||||
image: entities.DriveFile,
|
||||
options: {
|
||||
aspectRatio: number;
|
||||
},
|
||||
): Promise<firefish.entities.DriveFile> {
|
||||
): Promise<entities.DriveFile> {
|
||||
return new Promise((resolve, reject) => {
|
||||
popup(
|
||||
defineAsyncComponent({
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
<script lang="ts" setup>
|
||||
import { ref } from "vue";
|
||||
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import MkButton from "@/components/MkButton.vue";
|
||||
import { version } from "@/config";
|
||||
import * as os from "@/os";
|
||||
|
@ -56,7 +56,7 @@ withDefaults(
|
|||
|
||||
const loaded = ref(false);
|
||||
const serverIsDead = ref(false);
|
||||
const meta = ref<firefish.entities.LiteInstanceMetadata | null>(null);
|
||||
const meta = ref<entities.LiteInstanceMetadata | null>(null);
|
||||
|
||||
os.api("meta", {
|
||||
detail: false,
|
||||
|
|
|
@ -9,7 +9,9 @@
|
|||
<div class="body">
|
||||
<span class="name"><MkUserName class="name" :user="user" /></span>
|
||||
<span class="sub"
|
||||
><span class="acct _monospace">@{{ acct(user) }}</span></span
|
||||
><span class="acct _monospace"
|
||||
>@{{ acct.toString(user) }}</span
|
||||
></span
|
||||
>
|
||||
</div>
|
||||
<MkMiniChart v-if="chart" class="chart" :src="chart.inc" />
|
||||
|
@ -19,13 +21,12 @@
|
|||
<script lang="ts" setup>
|
||||
import { ref } from "vue";
|
||||
|
||||
import type * as firefish from "firefish-js";
|
||||
import { acct, type entities } from "firefish-js";
|
||||
import MkMiniChart from "@/components/MkMiniChart.vue";
|
||||
import * as os from "@/os";
|
||||
import { acct } from "@/filters/user";
|
||||
|
||||
const props = defineProps<{
|
||||
user: firefish.entities.User;
|
||||
user: entities.User;
|
||||
}>();
|
||||
|
||||
const chart = ref(null);
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { computed, provide, ref, watch } from "vue";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import XNotes from "@/components/MkNotes.vue";
|
||||
import { $i, isSignedIn } from "@/reactiveAccount";
|
||||
import { i18n } from "@/i18n";
|
||||
|
@ -41,7 +41,7 @@ const props = defineProps<{
|
|||
clipId: string;
|
||||
}>();
|
||||
|
||||
const clip = ref<firefish.entities.Clip>();
|
||||
const clip = ref<entities.Clip>();
|
||||
const pagination = {
|
||||
endpoint: "clips/notes" as const,
|
||||
limit: 10,
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
><MkUserName :user="req.follower"
|
||||
/></MkA>
|
||||
<p class="acct">
|
||||
@{{ acct(req.follower) }}
|
||||
@{{ acct.toString(req.follower) }}
|
||||
</p>
|
||||
</div>
|
||||
<div
|
||||
|
@ -84,7 +84,8 @@
|
|||
<script lang="ts" setup>
|
||||
import { computed, ref } from "vue";
|
||||
import MkPagination from "@/components/MkPagination.vue";
|
||||
import { acct, userPage } from "@/filters/user";
|
||||
import { acct } from "firefish-js";
|
||||
import { userPage } from "@/filters/user";
|
||||
import * as os from "@/os";
|
||||
import { i18n } from "@/i18n";
|
||||
import { definePageMetadata } from "@/scripts/page-metadata";
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import * as Acct from "firefish-js/built/acct";
|
||||
import { acct } from "firefish-js";
|
||||
import * as os from "@/os";
|
||||
import { mainRouter } from "@/router";
|
||||
import { i18n } from "@/i18n";
|
||||
|
@ -50,7 +50,7 @@ if (acct.startsWith("https://")) {
|
|||
}
|
||||
});
|
||||
} else {
|
||||
promise = os.api("users/show", Acct.parse(acct));
|
||||
promise = os.api("users/show", acct.parse(acct));
|
||||
promise.then((user) => {
|
||||
follow(user);
|
||||
});
|
||||
|
|
|
@ -338,7 +338,7 @@
|
|||
import { computed, ref, watch } from "vue";
|
||||
import { Virtual } from "swiper/modules";
|
||||
import { Swiper, SwiperSlide } from "swiper/vue";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import MkChart from "@/components/MkChart.vue";
|
||||
import MkObjectView from "@/components/MkObjectView.vue";
|
||||
import FormLink from "@/components/form/link.vue";
|
||||
|
@ -361,11 +361,11 @@ import icon from "@/scripts/icon";
|
|||
import "swiper/scss";
|
||||
import "swiper/scss/virtual";
|
||||
|
||||
type AugmentedInstanceMetadata = firefish.entities.DetailedInstanceMetadata & {
|
||||
type AugmentedInstanceMetadata = entities.DetailedInstanceMetadata & {
|
||||
blockedHosts: string[];
|
||||
silencedHosts: string[];
|
||||
};
|
||||
type AugmentedInstance = firefish.entities.Instance & {
|
||||
type AugmentedInstance = entities.Instance & {
|
||||
isBlocked: boolean;
|
||||
isSilenced: boolean;
|
||||
};
|
||||
|
|
|
@ -89,7 +89,7 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { computed, markRaw, onMounted, onUnmounted, ref, watch } from "vue";
|
||||
import * as Acct from "firefish-js/built/acct";
|
||||
import { acct } from "firefish-js";
|
||||
import { Virtual } from "swiper/modules";
|
||||
import { Swiper, SwiperSlide } from "swiper/vue";
|
||||
import MkButton from "@/components/MkButton.vue";
|
||||
|
@ -206,7 +206,7 @@ function onRead(ids): void {
|
|||
|
||||
async function startUser(): void {
|
||||
os.selectUser().then((user) => {
|
||||
router.push(`/my/messaging/${Acct.toString(user)}`);
|
||||
router.push(`/my/messaging/${acct.toString(user)}`);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { computed, onMounted, ref, watch } from "vue";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import autosize from "autosize";
|
||||
// import insertTextAtCursor from 'insert-text-at-cursor';
|
||||
import { throttle } from "throttle-debounce";
|
||||
|
@ -67,15 +67,15 @@ import { uploadFile } from "@/scripts/upload";
|
|||
import icon from "@/scripts/icon";
|
||||
|
||||
const props = defineProps<{
|
||||
user?: firefish.entities.UserDetailed | null;
|
||||
group?: firefish.entities.UserGroup | null;
|
||||
user?: entities.UserDetailed | null;
|
||||
group?: entities.UserGroup | null;
|
||||
}>();
|
||||
|
||||
const textEl = ref<HTMLTextAreaElement>();
|
||||
const fileEl = ref<HTMLInputElement>();
|
||||
|
||||
const text = ref<string>("");
|
||||
const file = ref<firefish.entities.DriveFile | null>(null);
|
||||
const file = ref<entities.DriveFile | null>(null);
|
||||
const sending = ref(false);
|
||||
const typing = throttle(3000, () => {
|
||||
stream.send(
|
||||
|
|
|
@ -85,7 +85,7 @@
|
|||
import { computed } from "vue";
|
||||
|
||||
import * as mfm from "mfm-js";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import XMediaList from "@/components/MkMediaList.vue";
|
||||
import { extractUrlFromMfm } from "@/scripts/extract-url-from-mfm";
|
||||
import MkUrlPreview from "@/components/MkUrlPreview.vue";
|
||||
|
@ -95,7 +95,7 @@ import { i18n } from "@/i18n";
|
|||
import icon from "@/scripts/icon";
|
||||
|
||||
const props = defineProps<{
|
||||
message: firefish.entities.MessagingMessage;
|
||||
message: entities.MessagingMessage;
|
||||
isGroup?: boolean;
|
||||
}>();
|
||||
|
||||
|
|
|
@ -105,8 +105,8 @@ import {
|
|||
ref,
|
||||
watch,
|
||||
} from "vue";
|
||||
import type * as firefish from "firefish-js";
|
||||
import * as Acct from "firefish-js/built/acct";
|
||||
import type { entities, Channels, ChannelConnection } from "firefish-js";
|
||||
import { acct } from "firefish-js";
|
||||
import XMessage from "./messaging-room.message.vue";
|
||||
import XForm from "./messaging-room.form.vue";
|
||||
import XList from "@/components/MkDateSeparatedList.vue";
|
||||
|
@ -137,12 +137,10 @@ const formEl = ref<InstanceType<typeof XForm>>();
|
|||
const pagingComponent = ref<InstanceType<typeof MkPagination>>();
|
||||
|
||||
const fetching = ref(true);
|
||||
const user = ref<firefish.entities.UserDetailed | null>(null);
|
||||
const group = ref<firefish.entities.UserGroup | null>(null);
|
||||
const typers = ref<firefish.entities.User[]>([]);
|
||||
const connection: firefish.ChannelConnection<
|
||||
firefish.Channels["messaging"]
|
||||
> | null = ref(null);
|
||||
const user = ref<entities.UserDetailed | null>(null);
|
||||
const group = ref<entities.UserGroup | null>(null);
|
||||
const typers = ref<entities.User[]>([]);
|
||||
const connection: ChannelConnection<Channels["messaging"]> | null = ref(null);
|
||||
const showIndicator = ref(false);
|
||||
const { animation } = defaultStore.reactiveState;
|
||||
|
||||
|
@ -157,10 +155,10 @@ async function fetch() {
|
|||
fetching.value = true;
|
||||
|
||||
if (props.userAcct) {
|
||||
const acct = Acct.parse(props.userAcct);
|
||||
const account = acct.parse(props.userAcct);
|
||||
user.value = await os.api("users/show", {
|
||||
username: acct.username,
|
||||
host: acct.host || undefined,
|
||||
username: account.username,
|
||||
host: account.host || undefined,
|
||||
});
|
||||
group.value = null;
|
||||
|
||||
|
|
|
@ -115,7 +115,7 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { ref, watch } from "vue";
|
||||
import * as Acct from "firefish-js/built/acct";
|
||||
import { acct } from "firefish-js";
|
||||
import MkButton from "@/components/MkButton.vue";
|
||||
import MkInput from "@/components/form/input.vue";
|
||||
import MkTextarea from "@/components/form/textarea.vue";
|
||||
|
@ -226,7 +226,7 @@ async function deleteAntenna() {
|
|||
function addUser() {
|
||||
os.selectUser().then((user) => {
|
||||
users.value = users.value.trim();
|
||||
users.value += `\n@${Acct.toString(user as any)}`;
|
||||
users.value += `\n@${acct.toString(user as any)}`;
|
||||
users.value = users.value.trim();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref, watch } from "vue";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import XNoteDetailed from "@/components/MkNoteDetailed.vue";
|
||||
import XNotes from "@/components/MkNotes.vue";
|
||||
import MkRemoteCaution from "@/components/MkRemoteCaution.vue";
|
||||
|
@ -85,14 +85,14 @@ const props = defineProps<{
|
|||
noteId: string;
|
||||
}>();
|
||||
|
||||
const note = ref<null | firefish.entities.Note>();
|
||||
const note = ref<null | entities.Note>();
|
||||
const hasPrev = ref(false);
|
||||
const hasNext = ref(false);
|
||||
const showPrev = ref(false);
|
||||
const showNext = ref(false);
|
||||
const error = ref();
|
||||
const isRenote = ref(false);
|
||||
const appearNote = ref<null | firefish.entities.Note>();
|
||||
const appearNote = ref<null | entities.Note>();
|
||||
|
||||
const prevPagination = {
|
||||
endpoint: "users/notes" as const,
|
||||
|
@ -138,7 +138,7 @@ function fetchNote() {
|
|||
note.value.fileIds.length === 0 &&
|
||||
note.value.poll == null;
|
||||
appearNote.value = isRenote.value
|
||||
? (note.value.renote as firefish.entities.Note)
|
||||
? (note.value.renote as entities.Note)
|
||||
: note.value;
|
||||
|
||||
Promise.all([
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
<script lang="ts" setup>
|
||||
import { ref } from "vue";
|
||||
|
||||
import { toString } from "firefish-js/built/acct";
|
||||
import { acct } from "firefish-js";
|
||||
import FormSection from "@/components/form/section.vue";
|
||||
import FormInput from "@/components/form/input.vue";
|
||||
import FormButton from "@/components/MkButton.vue";
|
||||
|
@ -73,7 +73,7 @@ async function init() {
|
|||
const aka = await os.api("users/show", { userIds: $i.alsoKnownAs });
|
||||
accountAlias.value =
|
||||
aka && aka.length > 0
|
||||
? aka.map((user) => `@${toString(user)}`)
|
||||
? aka.map((user) => `@${acct.toString(user)}`)
|
||||
: [""];
|
||||
} else {
|
||||
accountAlias.value = [""];
|
||||
|
|
|
@ -33,9 +33,7 @@
|
|||
import { computed, ref } from "vue";
|
||||
|
||||
// SPECIFICATION: https://misskey-hub.net/docs/features/share-form.html
|
||||
import { noteVisibilities } from "firefish-js";
|
||||
import * as Acct from "firefish-js/built/acct";
|
||||
import type * as firefish from "firefish-js";
|
||||
import { acct, noteVisibilities, type entities } from "firefish-js";
|
||||
import MkButton from "@/components/MkButton.vue";
|
||||
import XPostForm from "@/components/MkPostForm.vue";
|
||||
import * as os from "@/os";
|
||||
|
@ -53,16 +51,16 @@ const title = ref(urlParams.get("title"));
|
|||
const text = urlParams.get("text");
|
||||
const url = urlParams.get("url");
|
||||
const initialText = ref(null as string | null);
|
||||
const reply = ref(null as firefish.entities.Note | null);
|
||||
const renote = ref(null as firefish.entities.Note | null);
|
||||
const reply = ref(null as entities.Note | null);
|
||||
const renote = ref(null as entities.Note | null);
|
||||
const visibility = ref(
|
||||
noteVisibilities.includes(visibilityQuery) ? visibilityQuery : null,
|
||||
);
|
||||
const localOnly = ref(
|
||||
localOnlyQuery === "0" ? false : localOnlyQuery === "1" ? true : null,
|
||||
);
|
||||
const files = ref([] as firefish.entities.DriveFile[]);
|
||||
const visibleUsers = ref([] as firefish.entities.User[]);
|
||||
const files = ref([] as entities.DriveFile[]);
|
||||
const visibleUsers = ref([] as entities.User[]);
|
||||
|
||||
async function init() {
|
||||
let noteText = "";
|
||||
|
@ -83,7 +81,7 @@ async function init() {
|
|||
? visibleUserIds.split(",").map((userId) => ({ userId }))
|
||||
: []),
|
||||
...(visibleAccts
|
||||
? visibleAccts.split(",").map(Acct.parse)
|
||||
? visibleAccts.split(",").map(acct.parse)
|
||||
: []),
|
||||
]
|
||||
// TypeScriptの指示通りに変換する
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
/></span>
|
||||
<span class="sub"
|
||||
><span class="acct _monospace"
|
||||
>@{{ acct(user) }}</span
|
||||
>@{{ acct.toString(user) }}</span
|
||||
></span
|
||||
>
|
||||
<span class="state">
|
||||
|
@ -358,7 +358,7 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref, watch } from "vue";
|
||||
import type * as firefish from "firefish-js";
|
||||
import { acct, type entities } from "firefish-js";
|
||||
import MkChart from "@/components/MkChart.vue";
|
||||
import MkObjectView from "@/components/MkObjectView.vue";
|
||||
import FormTextarea from "@/components/form/textarea.vue";
|
||||
|
@ -374,7 +374,7 @@ import MkFileListForAdmin from "@/components/MkFileListForAdmin.vue";
|
|||
import MkInfo from "@/components/MkInfo.vue";
|
||||
import * as os from "@/os";
|
||||
import { url } from "@/config";
|
||||
import { acct, userPage } from "@/filters/user";
|
||||
import { userPage } from "@/filters/user";
|
||||
import { definePageMetadata } from "@/scripts/page-metadata";
|
||||
import { i18n } from "@/i18n";
|
||||
import { isAdmin, isModerator } from "@/reactiveAccount";
|
||||
|
@ -387,7 +387,7 @@ const props = defineProps<{
|
|||
|
||||
const tab = ref("overview");
|
||||
const chartSrc = ref("per-user-notes");
|
||||
const user = ref<null | firefish.entities.UserDetailed>();
|
||||
const user = ref<null | entities.UserDetailed>();
|
||||
const init = ref<ReturnType<typeof createFetcher>>();
|
||||
const info = ref();
|
||||
const ips = ref(null);
|
||||
|
@ -661,7 +661,7 @@ const headerTabs = computed(() =>
|
|||
|
||||
definePageMetadata(
|
||||
computed(() => ({
|
||||
title: user.value ? acct(user.value) : i18n.ts.userInfo,
|
||||
title: user.value ? acct.toString(user.value) : i18n.ts.userInfo,
|
||||
icon: `${icon("ph-info")}`,
|
||||
})),
|
||||
);
|
||||
|
|
|
@ -25,11 +25,11 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { computed } from "vue";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import MkPagination from "@/components/MkPagination.vue";
|
||||
|
||||
const props = defineProps<{
|
||||
user: firefish.entities.User;
|
||||
user: entities.User;
|
||||
}>();
|
||||
|
||||
const pagination = {
|
||||
|
|
|
@ -24,12 +24,12 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { computed } from "vue";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import MkUserInfo from "@/components/MkUserInfo.vue";
|
||||
import MkPagination from "@/components/MkPagination.vue";
|
||||
|
||||
const props = defineProps<{
|
||||
user: firefish.entities.User;
|
||||
user: entities.User;
|
||||
type: "following" | "followers";
|
||||
}>();
|
||||
|
||||
|
|
|
@ -17,8 +17,7 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref, watch } from "vue";
|
||||
import * as Acct from "firefish-js/built/acct";
|
||||
import type * as firefish from "firefish-js";
|
||||
import { acct, type entities } from "firefish-js";
|
||||
import XFollowList from "./follow-list.vue";
|
||||
import * as os from "@/os";
|
||||
import { definePageMetadata } from "@/scripts/page-metadata";
|
||||
|
@ -32,13 +31,13 @@ const props = withDefaults(
|
|||
{},
|
||||
);
|
||||
|
||||
const user = ref<null | firefish.entities.UserDetailed>(null);
|
||||
const user = ref<null | entities.UserDetailed>(null);
|
||||
const error = ref(null);
|
||||
|
||||
function fetchUser(): void {
|
||||
if (props.acct == null) return;
|
||||
user.value = null;
|
||||
os.api("users/show", Acct.parse(props.acct))
|
||||
os.api("users/show", acct.parse(props.acct))
|
||||
.then((u) => {
|
||||
user.value = u;
|
||||
})
|
||||
|
|
|
@ -17,8 +17,7 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref, watch } from "vue";
|
||||
import * as Acct from "firefish-js/built/acct";
|
||||
import type * as firefish from "firefish-js";
|
||||
import { acct, type entities } from "firefish-js";
|
||||
import XFollowList from "./follow-list.vue";
|
||||
import * as os from "@/os";
|
||||
import { definePageMetadata } from "@/scripts/page-metadata";
|
||||
|
@ -32,13 +31,13 @@ const props = withDefaults(
|
|||
{},
|
||||
);
|
||||
|
||||
const user = ref<null | firefish.entities.UserDetailed>(null);
|
||||
const user = ref<null | entities.UserDetailed>(null);
|
||||
const error = ref(null);
|
||||
|
||||
function fetchUser(): void {
|
||||
if (props.acct == null) return;
|
||||
user.value = null;
|
||||
os.api("users/show", Acct.parse(props.acct))
|
||||
os.api("users/show", acct.parse(props.acct))
|
||||
.then((u) => {
|
||||
user.value = u;
|
||||
})
|
||||
|
|
|
@ -15,13 +15,13 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { computed } from "vue";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import MkGalleryPostPreview from "@/components/MkGalleryPostPreview.vue";
|
||||
import MkPagination from "@/components/MkPagination.vue";
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
user: firefish.entities.User;
|
||||
user: entities.User;
|
||||
}>(),
|
||||
{},
|
||||
);
|
||||
|
|
|
@ -380,7 +380,7 @@ import {
|
|||
} from "vue";
|
||||
import calcAge from "s-age";
|
||||
import cityTimezones from "city-timezones";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import XUserTimeline from "./index.timeline.vue";
|
||||
import XNote from "@/components/MkNote.vue";
|
||||
import MkFollowButton from "@/components/MkFollowButton.vue";
|
||||
|
@ -406,7 +406,7 @@ const hideFollowButton = defaultStore.state.hideFollowButtons;
|
|||
const emit = defineEmits(["refresh"]);
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
user: firefish.entities.UserDetailed;
|
||||
user: entities.UserDetailed;
|
||||
}>(),
|
||||
{},
|
||||
);
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
<script lang="ts" setup>
|
||||
import { ref } from "vue";
|
||||
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import MkContainer from "@/components/MkContainer.vue";
|
||||
import MkChart from "@/components/MkChart.vue";
|
||||
import * as os from "@/os";
|
||||
|
@ -37,7 +37,7 @@ import icon from "@/scripts/icon";
|
|||
|
||||
withDefaults(
|
||||
defineProps<{
|
||||
user: firefish.entities.User;
|
||||
user: entities.User;
|
||||
limit?: number;
|
||||
}>(),
|
||||
{
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, ref } from "vue";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import { getStaticImageUrl } from "@/scripts/get-static-image-url";
|
||||
import { notePage } from "@/filters/note";
|
||||
import * as os from "@/os";
|
||||
|
@ -40,18 +40,18 @@ import { i18n } from "@/i18n";
|
|||
import icon from "@/scripts/icon";
|
||||
|
||||
const props = defineProps<{
|
||||
user: firefish.entities.UserDetailed;
|
||||
user: entities.UserDetailed;
|
||||
}>();
|
||||
|
||||
const fetching = ref(true);
|
||||
const images = ref<
|
||||
{
|
||||
note: firefish.entities.Note;
|
||||
file: firefish.entities.DriveFile;
|
||||
note: entities.Note;
|
||||
file: entities.DriveFile;
|
||||
}[]
|
||||
>([]);
|
||||
|
||||
function thumbnail(image: firefish.entities.DriveFile): string {
|
||||
function thumbnail(image: entities.DriveFile): string {
|
||||
return defaultStore.state.disableShowingAnimatedImages
|
||||
? getStaticImageUrl(image.thumbnailUrl)
|
||||
: image.thumbnailUrl;
|
||||
|
|
|
@ -13,13 +13,13 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref } from "vue";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import XNotes from "@/components/MkNotes.vue";
|
||||
import MkTab from "@/components/MkTab.vue";
|
||||
import { i18n } from "@/i18n";
|
||||
|
||||
const props = defineProps<{
|
||||
user: firefish.entities.UserDetailed;
|
||||
user: entities.UserDetailed;
|
||||
}>();
|
||||
|
||||
const include = ref<string | null>(null);
|
||||
|
|
|
@ -30,9 +30,7 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { computed, defineAsyncComponent, ref, watch } from "vue";
|
||||
import * as Acct from "firefish-js/built/acct";
|
||||
import type * as firefish from "firefish-js";
|
||||
import { acct as getAcct } from "@/filters/user";
|
||||
import { acct, type entities } from "firefish-js";
|
||||
import * as os from "@/os";
|
||||
import { useRouter } from "@/router";
|
||||
import { definePageMetadata } from "@/scripts/page-metadata";
|
||||
|
@ -59,13 +57,13 @@ const props = withDefaults(
|
|||
useRouter();
|
||||
|
||||
const tab = ref(props.page);
|
||||
const user = ref<null | firefish.entities.UserDetailed>(null);
|
||||
const user = ref<null | entities.UserDetailed>(null);
|
||||
const error = ref(null);
|
||||
|
||||
function fetchUser(): void {
|
||||
if (props.acct == null) return;
|
||||
user.value = null;
|
||||
os.api("users/show", Acct.parse(props.acct))
|
||||
os.api("users/show", acct.parse(props.acct))
|
||||
.then((u) => {
|
||||
user.value = u;
|
||||
})
|
||||
|
@ -129,7 +127,7 @@ definePageMetadata(
|
|||
title: user.value.name
|
||||
? `${user.value.name} (@${user.value.username})`
|
||||
: `@${user.value.username}`,
|
||||
subtitle: `@${getAcct(user.value)}`,
|
||||
subtitle: `@${acct.toString(user.value)}`,
|
||||
userName: user.value,
|
||||
avatar: user.value,
|
||||
path: `/@${user.value.username}`,
|
||||
|
|
|
@ -13,12 +13,12 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { computed } from "vue";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import MkPagePreview from "@/components/MkPagePreview.vue";
|
||||
import MkPagination from "@/components/MkPagination.vue";
|
||||
|
||||
const props = defineProps<{
|
||||
user: firefish.entities.User;
|
||||
user: entities.User;
|
||||
}>();
|
||||
|
||||
const pagination = {
|
||||
|
|
|
@ -25,13 +25,13 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { computed } from "vue";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import MkPagination from "@/components/MkPagination.vue";
|
||||
import MkNote from "@/components/MkNote.vue";
|
||||
import MkReactionIcon from "@/components/MkReactionIcon.vue";
|
||||
|
||||
const props = defineProps<{
|
||||
user: firefish.entities.User;
|
||||
user: entities.User;
|
||||
}>();
|
||||
|
||||
const pagination = {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
|
||||
export interface Muted {
|
||||
muted: boolean;
|
||||
|
@ -9,7 +9,7 @@ export interface Muted {
|
|||
const NotMuted = { muted: false, matched: [] };
|
||||
|
||||
function checkLangMute(
|
||||
note: firefish.entities.Note,
|
||||
note: entities.Note,
|
||||
mutedLangs: Array<string | string[]>,
|
||||
): Muted {
|
||||
const mutedLangList = new Set(
|
||||
|
@ -22,7 +22,7 @@ function checkLangMute(
|
|||
}
|
||||
|
||||
function checkWordMute(
|
||||
note: firefish.entities.Note,
|
||||
note: entities.Note,
|
||||
mutedWords: Array<string | string[]>,
|
||||
): Muted {
|
||||
let text = `${note.cw ?? ""} ${note.text ?? ""}`;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import * as Acct from "firefish-js/built/acct";
|
||||
import { acct } from "firefish-js";
|
||||
import { host as localHost } from "@/config";
|
||||
|
||||
export async function genSearchQuery(v: any, q: string) {
|
||||
|
@ -16,7 +16,7 @@ export async function genSearchQuery(v: any, q: string) {
|
|||
}
|
||||
} else {
|
||||
const user = await v.os
|
||||
.api("users/show", Acct.parse(at))
|
||||
.api("users/show", acct.parse(at))
|
||||
.catch((x) => null);
|
||||
if (user) {
|
||||
userId = user.id;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import type { Ref } from "vue";
|
||||
import { defineAsyncComponent } from "vue";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import { $i, isSignedIn, isModerator } from "@/reactiveAccount";
|
||||
import { i18n } from "@/i18n";
|
||||
import { instance } from "@/instance";
|
||||
|
@ -13,12 +13,12 @@ import { getUserMenu } from "@/scripts/get-user-menu";
|
|||
import icon from "@/scripts/icon";
|
||||
|
||||
export function getNoteMenu(props: {
|
||||
note: firefish.entities.Note;
|
||||
note: entities.Note;
|
||||
menuButton: Ref<HTMLElement | undefined>;
|
||||
translation: Ref<any>;
|
||||
translating: Ref<boolean>;
|
||||
isDeleted: Ref<boolean>;
|
||||
currentClipPage?: Ref<firefish.entities.Clip>;
|
||||
currentClipPage?: Ref<entities.Clip>;
|
||||
}) {
|
||||
const isRenote =
|
||||
props.note.renote != null &&
|
||||
|
@ -27,7 +27,7 @@ export function getNoteMenu(props: {
|
|||
props.note.poll == null;
|
||||
|
||||
const appearNote = isRenote
|
||||
? (props.note.renote as firefish.entities.Note)
|
||||
? (props.note.renote as entities.Note)
|
||||
: props.note;
|
||||
|
||||
function del(): void {
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
|
||||
/**
|
||||
* 投稿を表す文字列を取得します。
|
||||
* @param {*} note (packされた)投稿
|
||||
*/
|
||||
export const getNoteSummary = (note: firefish.entities.Note): string => {
|
||||
export const getNoteSummary = (note: entities.Note): string => {
|
||||
/*
|
||||
if (note.deletedAt) {
|
||||
return `(${i18n.ts.deletedNote})`;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import * as Acct from "firefish-js/built/acct";
|
||||
import { acct } from "firefish-js";
|
||||
import { defineAsyncComponent } from "vue";
|
||||
import { i18n } from "@/i18n";
|
||||
import copyToClipboard from "@/scripts/copy-to-clipboard";
|
||||
|
@ -284,7 +284,7 @@ export function getUserMenu(user, router: Router = mainRouter) {
|
|||
type: "link",
|
||||
icon: `${icon("ph-chats-teardrop")}`,
|
||||
text: i18n.ts.startMessaging,
|
||||
to: `/my/messaging/${Acct.toString(user)}`,
|
||||
to: `/my/messaging/${acct.toString(user)}`,
|
||||
}
|
||||
: undefined,
|
||||
user.host != null && user.url
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import * as Acct from "firefish-js/built/acct";
|
||||
import { acct } from "firefish-js";
|
||||
import { i18n } from "@/i18n";
|
||||
import * as os from "@/os";
|
||||
|
||||
|
@ -12,7 +12,7 @@ export async function lookupUser() {
|
|||
os.pageWindow(`/user-info/${user.id}`);
|
||||
};
|
||||
|
||||
const usernamePromise = os.api("users/show", Acct.parse(result));
|
||||
const usernamePromise = os.api("users/show", acct.parse(result));
|
||||
const idPromise = os.api("users/show", { userId: result });
|
||||
let _notFound = false;
|
||||
const notFound = () => {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import type { ComputedRef, Ref } from "vue";
|
||||
import { inject, isRef, onActivated, onMounted, provide, ref } from "vue";
|
||||
|
||||
|
@ -9,8 +9,8 @@ export interface PageMetadata {
|
|||
title: string;
|
||||
subtitle?: string;
|
||||
icon?: string | null;
|
||||
avatar?: firefish.entities.User | null;
|
||||
userName?: firefish.entities.User | null;
|
||||
avatar?: entities.User | null;
|
||||
userName?: entities.User | null;
|
||||
bg?: string;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { ref } from "vue";
|
||||
import type { DriveFile } from "firefish-js/built/entities";
|
||||
import type { entities } from "firefish-js";
|
||||
import * as os from "@/os";
|
||||
import { stream } from "@/stream";
|
||||
import { i18n } from "@/i18n";
|
||||
|
@ -11,7 +11,7 @@ function select(
|
|||
src: any,
|
||||
label: string | null,
|
||||
multiple: boolean,
|
||||
): Promise<DriveFile | DriveFile[]> {
|
||||
): Promise<entities.DriveFile | entities.DriveFile[]> {
|
||||
return new Promise((res, rej) => {
|
||||
const keepOriginal = ref(defaultStore.state.keepOriginalUploading);
|
||||
|
||||
|
@ -122,13 +122,13 @@ function select(
|
|||
export function selectFile(
|
||||
src: any,
|
||||
label: string | null = null,
|
||||
): Promise<DriveFile> {
|
||||
return select(src, label, false) as Promise<DriveFile>;
|
||||
): Promise<entities.DriveFile> {
|
||||
return select(src, label, false) as Promise<entities.DriveFile>;
|
||||
}
|
||||
|
||||
export function selectFiles(
|
||||
src: any,
|
||||
label: string | null = null,
|
||||
): Promise<DriveFile[]> {
|
||||
return select(src, label, true) as Promise<DriveFile[]>;
|
||||
): Promise<entities.DriveFile[]> {
|
||||
return select(src, label, true) as Promise<entities.DriveFile[]>;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { reactive, ref } from "vue";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import { readAndCompressImage } from "browser-image-resizer";
|
||||
import { defaultStore } from "@/store";
|
||||
import { apiUrl } from "@/config";
|
||||
|
@ -34,7 +34,7 @@ export function uploadFile(
|
|||
folder?: any,
|
||||
name?: string,
|
||||
keepOriginal: boolean = defaultStore.state.keepOriginalUploading,
|
||||
): Promise<firefish.entities.DriveFile> {
|
||||
): Promise<entities.DriveFile> {
|
||||
if (folder && typeof folder === "object") folder = folder.id;
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
import type { Ref } from "vue";
|
||||
import { onUnmounted } from "vue";
|
||||
import type * as firefish from "firefish-js";
|
||||
import type { entities } from "firefish-js";
|
||||
import { stream } from "@/stream";
|
||||
import { $i, isSignedIn } from "@/reactiveAccount";
|
||||
import * as os from "@/os";
|
||||
|
||||
export function useNoteCapture(props: {
|
||||
rootEl: Ref<HTMLElement>;
|
||||
note: Ref<firefish.entities.Note>;
|
||||
note: Ref<entities.Note>;
|
||||
isDeletedRef: Ref<boolean>;
|
||||
}) {
|
||||
const note = props.note;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import * as firefish from "firefish-js";
|
||||
import { Stream } from "firefish-js";
|
||||
import { markRaw } from "vue";
|
||||
import { url } from "@/config";
|
||||
import { $i } from "@/reactiveAccount";
|
||||
|
||||
export const stream = markRaw(
|
||||
new firefish.Stream(
|
||||
new Stream(
|
||||
url,
|
||||
$i
|
||||
? {
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue