forked from naskya/firefish
refactor: stop importing stuff from firefish-js/built
This commit is contained in:
parent
f1e1f9e5b0
commit
c035c368c7
28 changed files with 101 additions and 97 deletions
|
@ -63,12 +63,12 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import * as Acct from "firefish-js/built/acct";
|
import * as firefishJs from "firefish-js";
|
||||||
import { i18n } from "@/i18n";
|
import { i18n } from "@/i18n";
|
||||||
import { acct } from "@/filters/user";
|
import { acct } from "@/filters/user";
|
||||||
import { $i } from "@/reactiveAccount";
|
import { $i } from "@/reactiveAccount";
|
||||||
|
|
||||||
const getAcct = Acct.toString;
|
const getAcct = firefishJs.acct.toString;
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
message: Record<string, any>;
|
message: Record<string, any>;
|
||||||
|
|
|
@ -205,13 +205,12 @@
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, onBeforeUnmount, onMounted, ref, shallowRef } from "vue";
|
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 MkModal from "@/components/MkModal.vue";
|
||||||
import MkButton from "@/components/MkButton.vue";
|
import MkButton from "@/components/MkButton.vue";
|
||||||
import MkInput from "@/components/form/input.vue";
|
import MkInput from "@/components/form/input.vue";
|
||||||
import MkTextarea from "@/components/form/textarea.vue";
|
import MkTextarea from "@/components/form/textarea.vue";
|
||||||
import MkSelect from "@/components/form/select.vue";
|
import MkSelect from "@/components/form/select.vue";
|
||||||
import * as os from "@/os";
|
|
||||||
import { i18n } from "@/i18n";
|
import { i18n } from "@/i18n";
|
||||||
import iconClass from "@/scripts/icon";
|
import iconClass from "@/scripts/icon";
|
||||||
|
|
||||||
|
@ -354,12 +353,12 @@ function onInputKeydown(evt: KeyboardEvent) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function formatDateToYYYYMMDD(date) {
|
// function formatDateToYYYYMMDD(date) {
|
||||||
const year = date.getFullYear();
|
// const year = date.getFullYear();
|
||||||
const month = ("0" + (date.getMonth() + 1)).slice(-2);
|
// const month = ("0" + (date.getMonth() + 1)).slice(-2);
|
||||||
const day = ("0" + (date.getDate() + 1)).slice(-2);
|
// const day = ("0" + (date.getDate() + 1)).slice(-2);
|
||||||
return `${year}-${month}-${day}`;
|
// return `${year}-${month}-${day}`;
|
||||||
}
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Appends a new search parameter to the value in the input field.
|
* Appends a new search parameter to the value in the input field.
|
||||||
|
@ -367,18 +366,18 @@ function formatDateToYYYYMMDD(date) {
|
||||||
* begin typing a new criteria.
|
* begin typing a new criteria.
|
||||||
* @param value The value to append.
|
* @param value The value to append.
|
||||||
*/
|
*/
|
||||||
function appendFilter(value: string) {
|
// function appendFilter(value: string) {
|
||||||
return (
|
// return (
|
||||||
[
|
// [
|
||||||
typeof inputValue.value === "string"
|
// typeof inputValue.value === "string"
|
||||||
? inputValue.value.trim()
|
// ? inputValue.value.trim()
|
||||||
: inputValue.value,
|
// : inputValue.value,
|
||||||
value,
|
// value,
|
||||||
]
|
// ]
|
||||||
.join(" ")
|
// .join(" ")
|
||||||
.trim() + " "
|
// .trim() + " "
|
||||||
);
|
// );
|
||||||
}
|
// }
|
||||||
|
|
||||||
// async function openSearchFilters(ev) {
|
// async function openSearchFilters(ev) {
|
||||||
// await os.popupMenu(
|
// await os.popupMenu(
|
||||||
|
@ -389,7 +388,7 @@ function appendFilter(value: string) {
|
||||||
// action: () => {
|
// action: () => {
|
||||||
// os.selectUser().then((user) => {
|
// os.selectUser().then((user) => {
|
||||||
// inputValue.value = appendFilter(
|
// inputValue.value = appendFilter(
|
||||||
// "from:@" + Acct.toString(user),
|
// "from:@" + acct.toString(user),
|
||||||
// );
|
// );
|
||||||
// });
|
// });
|
||||||
// },
|
// },
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
`${file.type}\n${bytes(file.size)}\n${new Date(
|
`${file.type}\n${bytes(file.size)}\n${new Date(
|
||||||
file.createdAt,
|
file.createdAt,
|
||||||
).toLocaleString()}\nby ${
|
).toLocaleString()}\nby ${
|
||||||
file.user ? '@' + Acct.toString(file.user) : 'system'
|
file.user ? '@' + acct.toString(file.user) : 'system'
|
||||||
}`
|
}`
|
||||||
"
|
"
|
||||||
:to="`/admin/file/${file.id}`"
|
:to="`/admin/file/${file.id}`"
|
||||||
|
@ -54,7 +54,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import * as Acct from "firefish-js/built/acct";
|
import { acct } from "firefish-js";
|
||||||
import MkPagination from "@/components/MkPagination.vue";
|
import MkPagination from "@/components/MkPagination.vue";
|
||||||
import MkDriveFileThumbnail from "@/components/MkDriveFileThumbnail.vue";
|
import MkDriveFileThumbnail from "@/components/MkDriveFileThumbnail.vue";
|
||||||
import bytes from "@/filters/bytes";
|
import bytes from "@/filters/bytes";
|
||||||
|
|
|
@ -58,21 +58,21 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
|
|
||||||
import type { Instance } from "firefish-js/built/entities";
|
import { entities } from "firefish-js";
|
||||||
import MkInput from "@/components/form/input.vue";
|
import MkInput from "@/components/form/input.vue";
|
||||||
import XModalWindow from "@/components/MkModalWindow.vue";
|
import XModalWindow from "@/components/MkModalWindow.vue";
|
||||||
import * as os from "@/os";
|
import * as os from "@/os";
|
||||||
import { i18n } from "@/i18n";
|
import { i18n } from "@/i18n";
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(ev: "ok", selected: Instance): void;
|
(ev: "ok", selected: entities.Instance): void;
|
||||||
(ev: "cancel"): void;
|
(ev: "cancel"): void;
|
||||||
(ev: "closed"): void;
|
(ev: "closed"): void;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const hostname = ref("");
|
const hostname = ref("");
|
||||||
const instances: Instance[] = ref([]);
|
const instances: entities.Instance[] = ref([]);
|
||||||
const selected: Instance | null = ref(null);
|
const selected: entities.Instance | null = ref(null);
|
||||||
const dialogEl = ref<InstanceType<typeof XModalWindow>>();
|
const dialogEl = ref<InstanceType<typeof XModalWindow>>();
|
||||||
|
|
||||||
let searchOrderLatch = 0;
|
let searchOrderLatch = 0;
|
||||||
|
@ -97,7 +97,7 @@ const search = () => {
|
||||||
id: x.id,
|
id: x.id,
|
||||||
host: x.host,
|
host: x.host,
|
||||||
iconUrl: x.iconUrl,
|
iconUrl: x.iconUrl,
|
||||||
}) as Instance,
|
}) as entities.Instance,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -168,7 +168,7 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onMounted, onUnmounted, onUpdated, ref } from "vue";
|
import { onMounted, onUnmounted, onUpdated, ref } from "vue";
|
||||||
import type * as firefish from "firefish-js";
|
import type * as firefish from "firefish-js";
|
||||||
import type { NoteUpdatedEvent } from "firefish-js/built/streaming.types";
|
import { StreamTypes } from "firefish-js";
|
||||||
import MkTab from "@/components/MkTab.vue";
|
import MkTab from "@/components/MkTab.vue";
|
||||||
import MkNote from "@/components/MkNote.vue";
|
import MkNote from "@/components/MkNote.vue";
|
||||||
import MkNoteSub from "@/components/MkNoteSub.vue";
|
import MkNoteSub from "@/components/MkNoteSub.vue";
|
||||||
|
@ -416,7 +416,9 @@ function loadTab() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function onNoteUpdated(noteData: NoteUpdatedEvent): Promise<void> {
|
async function onNoteUpdated(
|
||||||
|
noteData: StreamTypes.NoteUpdatedEvent,
|
||||||
|
): Promise<void> {
|
||||||
const { type, id, body } = noteData;
|
const { type, id, body } = noteData;
|
||||||
|
|
||||||
let found = -1;
|
let found = -1;
|
||||||
|
|
|
@ -284,7 +284,7 @@ import autosize from "autosize";
|
||||||
import insertTextAtCursor from "insert-text-at-cursor";
|
import insertTextAtCursor from "insert-text-at-cursor";
|
||||||
import { length } from "stringz";
|
import { length } from "stringz";
|
||||||
import { toASCII } from "punycode/";
|
import { toASCII } from "punycode/";
|
||||||
import * as Acct from "firefish-js/built/acct";
|
import { acct } from "firefish-js";
|
||||||
import { throttle } from "throttle-debounce";
|
import { throttle } from "throttle-debounce";
|
||||||
import XNoteSimple from "@/components/MkNoteSimple.vue";
|
import XNoteSimple from "@/components/MkNoteSimple.vue";
|
||||||
import XNotePreview from "@/components/MkNotePreview.vue";
|
import XNotePreview from "@/components/MkNotePreview.vue";
|
||||||
|
@ -1116,7 +1116,7 @@ function cancel() {
|
||||||
|
|
||||||
function insertMention() {
|
function insertMention() {
|
||||||
os.selectUser().then((user) => {
|
os.selectUser().then((user) => {
|
||||||
insertTextAtCursor(textareaEl.value, "@" + Acct.toString(user) + " ");
|
insertTextAtCursor(textareaEl.value, "@" + acct.toString(user) + " ");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed } from "vue";
|
import { computed } from "vue";
|
||||||
import type { Note } from "firefish-js/built/entities";
|
import { entities } from "firefish-js";
|
||||||
import { pleaseLogin } from "@/scripts/please-login";
|
import { pleaseLogin } from "@/scripts/please-login";
|
||||||
import * as os from "@/os";
|
import * as os from "@/os";
|
||||||
import { $i } from "@/reactiveAccount";
|
import { $i } from "@/reactiveAccount";
|
||||||
|
@ -20,7 +20,7 @@ import { defaultStore } from "@/store";
|
||||||
import icon from "@/scripts/icon";
|
import icon from "@/scripts/icon";
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
note: Note;
|
note: entities.Note;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const canRenote = computed(
|
const canRenote = computed(
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { Note } from "firefish-js/built/entities";
|
import { entities } from "firefish-js";
|
||||||
import Ripple from "@/components/MkRipple.vue";
|
import Ripple from "@/components/MkRipple.vue";
|
||||||
import { pleaseLogin } from "@/scripts/please-login";
|
import { pleaseLogin } from "@/scripts/please-login";
|
||||||
import * as os from "@/os";
|
import * as os from "@/os";
|
||||||
|
@ -52,7 +52,7 @@ import { instance } from "@/instance";
|
||||||
import icon from "@/scripts/icon";
|
import icon from "@/scripts/icon";
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
note: Note;
|
note: entities.Note;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
function star(ev?: MouseEvent): void {
|
function star(ev?: MouseEvent): void {
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
import type { Note } from "firefish-js/built/entities";
|
import { entities } from "firefish-js";
|
||||||
import Ripple from "@/components/MkRipple.vue";
|
import Ripple from "@/components/MkRipple.vue";
|
||||||
import XDetails from "@/components/MkUsersTooltip.vue";
|
import XDetails from "@/components/MkUsersTooltip.vue";
|
||||||
import { pleaseLogin } from "@/scripts/please-login";
|
import { pleaseLogin } from "@/scripts/please-login";
|
||||||
|
@ -50,7 +50,7 @@ import { useTooltip } from "@/scripts/use-tooltip";
|
||||||
import icon from "@/scripts/icon";
|
import icon from "@/scripts/icon";
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
note: Note;
|
note: entities.Note;
|
||||||
count: number;
|
count: number;
|
||||||
reacted: boolean;
|
reacted: boolean;
|
||||||
}>();
|
}>();
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onMounted, ref } from "vue";
|
import { onMounted, ref } from "vue";
|
||||||
import * as Acct from "firefish-js/built/acct";
|
import { acct } from "firefish-js";
|
||||||
import type * as firefish from "firefish-js";
|
import type * as firefish from "firefish-js";
|
||||||
import MkUserInfo from "@/components/MkUserInfo.vue";
|
import MkUserInfo from "@/components/MkUserInfo.vue";
|
||||||
import * as os from "@/os";
|
import * as os from "@/os";
|
||||||
|
@ -57,7 +57,7 @@ onMounted(() => {
|
||||||
user.value = props.q;
|
user.value = props.q;
|
||||||
} else {
|
} else {
|
||||||
const query = props.q.startsWith("@")
|
const query = props.q.startsWith("@")
|
||||||
? Acct.parse(props.q.slice(1))
|
? acct.parse(props.q.slice(1))
|
||||||
: { userId: props.q };
|
: { userId: props.q };
|
||||||
|
|
||||||
os.api("users/show", query).then((res) => {
|
os.api("users/show", query).then((res) => {
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed } from "vue";
|
import { computed } from "vue";
|
||||||
import type { CustomEmoji } from "firefish-js/built/entities";
|
import { entities } from "firefish-js";
|
||||||
import { getStaticImageUrl } from "@/scripts/get-static-image-url";
|
import { getStaticImageUrl } from "@/scripts/get-static-image-url";
|
||||||
import { char2filePath } from "@/scripts/twemoji-base";
|
import { char2filePath } from "@/scripts/twemoji-base";
|
||||||
import { defaultStore } from "@/store";
|
import { defaultStore } from "@/store";
|
||||||
|
@ -32,7 +32,7 @@ const props = defineProps<{
|
||||||
emoji: string;
|
emoji: string;
|
||||||
normal?: boolean;
|
normal?: boolean;
|
||||||
noStyle?: boolean;
|
noStyle?: boolean;
|
||||||
customEmojis?: CustomEmoji[];
|
customEmojis?: entities.CustomEmoji[];
|
||||||
isReaction?: boolean;
|
isReaction?: boolean;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
import type * as firefish from "firefish-js";
|
import * as firefish from "firefish-js";
|
||||||
import * as Acct from "firefish-js/built/acct";
|
|
||||||
import { url } from "@/config";
|
import { url } from "@/config";
|
||||||
|
|
||||||
export const acct = (user: firefish.Acct) => {
|
export const acct = (user: firefish.Acct) => {
|
||||||
return Acct.toString(user);
|
return firefish.acct.toString(user);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const userName = (user: firefish.entities.User) => {
|
export const userName = (user: firefish.entities.User) => {
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import * as Acct from "firefish-js/built/acct";
|
import * as firefishJs from "firefish-js";
|
||||||
import * as os from "@/os";
|
import * as os from "@/os";
|
||||||
import { mainRouter } from "@/router";
|
import { mainRouter } from "@/router";
|
||||||
import { i18n } from "@/i18n";
|
import { i18n } from "@/i18n";
|
||||||
|
@ -50,7 +50,7 @@ if (acct.startsWith("https://")) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
promise = os.api("users/show", Acct.parse(acct));
|
promise = os.api("users/show", firefishJs.acct.parse(acct));
|
||||||
promise.then((user) => {
|
promise.then((user) => {
|
||||||
follow(user);
|
follow(user);
|
||||||
});
|
});
|
||||||
|
|
|
@ -89,7 +89,7 @@
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, markRaw, onMounted, onUnmounted, ref, watch } from "vue";
|
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 { Virtual } from "swiper/modules";
|
||||||
import { Swiper, SwiperSlide } from "swiper/vue";
|
import { Swiper, SwiperSlide } from "swiper/vue";
|
||||||
import MkButton from "@/components/MkButton.vue";
|
import MkButton from "@/components/MkButton.vue";
|
||||||
|
@ -207,7 +207,7 @@ function onRead(ids): void {
|
||||||
|
|
||||||
async function startUser(): void {
|
async function startUser(): void {
|
||||||
os.selectUser().then((user) => {
|
os.selectUser().then((user) => {
|
||||||
router.push(`/my/messaging/${Acct.toString(user)}`);
|
router.push(`/my/messaging/${acct.toString(user)}`);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -105,8 +105,7 @@ import {
|
||||||
ref,
|
ref,
|
||||||
watch,
|
watch,
|
||||||
} from "vue";
|
} from "vue";
|
||||||
import type * as firefish from "firefish-js";
|
import * as firefishJs from "firefish-js";
|
||||||
import * as Acct from "firefish-js/built/acct";
|
|
||||||
import XMessage from "./messaging-room.message.vue";
|
import XMessage from "./messaging-room.message.vue";
|
||||||
import XForm from "./messaging-room.form.vue";
|
import XForm from "./messaging-room.form.vue";
|
||||||
import XList from "@/components/MkDateSeparatedList.vue";
|
import XList from "@/components/MkDateSeparatedList.vue";
|
||||||
|
@ -139,11 +138,11 @@ const formEl = ref<InstanceType<typeof XForm>>();
|
||||||
const pagingComponent = ref<InstanceType<typeof MkPagination>>();
|
const pagingComponent = ref<InstanceType<typeof MkPagination>>();
|
||||||
|
|
||||||
const fetching = ref(true);
|
const fetching = ref(true);
|
||||||
const user = ref<firefish.entities.UserDetailed | null>(null);
|
const user = ref<firefishJs.entities.UserDetailed | null>(null);
|
||||||
const group = ref<firefish.entities.UserGroup | null>(null);
|
const group = ref<firefishJs.entities.UserGroup | null>(null);
|
||||||
const typers = ref<firefish.entities.User[]>([]);
|
const typers = ref<firefishJs.entities.User[]>([]);
|
||||||
const connection: firefish.ChannelConnection<
|
const connection: firefishJs.ChannelConnection<
|
||||||
firefish.Channels["messaging"]
|
firefishJs.StreamTypes.Channels["messaging"]
|
||||||
> | null = ref(null);
|
> | null = ref(null);
|
||||||
const showIndicator = ref(false);
|
const showIndicator = ref(false);
|
||||||
const { animation } = defaultStore.reactiveState;
|
const { animation } = defaultStore.reactiveState;
|
||||||
|
@ -159,7 +158,7 @@ async function fetch() {
|
||||||
fetching.value = true;
|
fetching.value = true;
|
||||||
|
|
||||||
if (props.userAcct) {
|
if (props.userAcct) {
|
||||||
const acct = Acct.parse(props.userAcct);
|
const acct = firefishJs.acct.parse(props.userAcct);
|
||||||
user.value = await os.api("users/show", {
|
user.value = await os.api("users/show", {
|
||||||
username: acct.username,
|
username: acct.username,
|
||||||
host: acct.host ?? undefined,
|
host: acct.host ?? undefined,
|
||||||
|
|
|
@ -115,7 +115,7 @@
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, watch } from "vue";
|
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 MkButton from "@/components/MkButton.vue";
|
||||||
import MkInput from "@/components/form/input.vue";
|
import MkInput from "@/components/form/input.vue";
|
||||||
import MkTextarea from "@/components/form/textarea.vue";
|
import MkTextarea from "@/components/form/textarea.vue";
|
||||||
|
@ -226,7 +226,7 @@ async function deleteAntenna() {
|
||||||
function addUser() {
|
function addUser() {
|
||||||
os.selectUser().then((user) => {
|
os.selectUser().then((user) => {
|
||||||
users.value = users.value.trim();
|
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();
|
users.value = users.value.trim();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,7 +52,7 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
|
|
||||||
import { toString } from "firefish-js/built/acct";
|
import { acct } from "firefish-js";
|
||||||
import FormSection from "@/components/form/section.vue";
|
import FormSection from "@/components/form/section.vue";
|
||||||
import FormInput from "@/components/form/input.vue";
|
import FormInput from "@/components/form/input.vue";
|
||||||
import FormButton from "@/components/MkButton.vue";
|
import FormButton from "@/components/MkButton.vue";
|
||||||
|
@ -73,7 +73,7 @@ async function init() {
|
||||||
const aka = await os.api("users/show", { userIds: $i.alsoKnownAs });
|
const aka = await os.api("users/show", { userIds: $i.alsoKnownAs });
|
||||||
accountAlias.value =
|
accountAlias.value =
|
||||||
aka && aka.length > 0
|
aka && aka.length > 0
|
||||||
? aka.map((user) => `@${toString(user)}`)
|
? aka.map((user) => `@${acct.toString(user)}`)
|
||||||
: [""];
|
: [""];
|
||||||
} else {
|
} else {
|
||||||
accountAlias.value = [""];
|
accountAlias.value = [""];
|
||||||
|
|
|
@ -34,7 +34,7 @@ import { computed, ref } from "vue";
|
||||||
|
|
||||||
// SPECIFICATION: https://misskey-hub.net/docs/features/share-form.html
|
// SPECIFICATION: https://misskey-hub.net/docs/features/share-form.html
|
||||||
import { noteVisibilities } from "firefish-js";
|
import { noteVisibilities } from "firefish-js";
|
||||||
import * as Acct from "firefish-js/built/acct";
|
import { acct } from "firefish-js";
|
||||||
import type * as firefish from "firefish-js";
|
import type * as firefish from "firefish-js";
|
||||||
import MkButton from "@/components/MkButton.vue";
|
import MkButton from "@/components/MkButton.vue";
|
||||||
import XPostForm from "@/components/MkPostForm.vue";
|
import XPostForm from "@/components/MkPostForm.vue";
|
||||||
|
@ -83,7 +83,7 @@ async function init() {
|
||||||
? visibleUserIds.split(",").map((userId) => ({ userId }))
|
? visibleUserIds.split(",").map((userId) => ({ userId }))
|
||||||
: []),
|
: []),
|
||||||
...(visibleAccts
|
...(visibleAccts
|
||||||
? visibleAccts.split(",").map(Acct.parse)
|
? visibleAccts.split(",").map(acct.parse)
|
||||||
: []),
|
: []),
|
||||||
]
|
]
|
||||||
// TypeScriptの指示通りに変換する
|
// TypeScriptの指示通りに変換する
|
||||||
|
|
|
@ -17,8 +17,7 @@
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, ref, watch } from "vue";
|
import { computed, ref, watch } from "vue";
|
||||||
import * as Acct from "firefish-js/built/acct";
|
import * as firefishJs from "firefish-js";
|
||||||
import type * as firefish from "firefish-js";
|
|
||||||
import XFollowList from "./follow-list.vue";
|
import XFollowList from "./follow-list.vue";
|
||||||
import * as os from "@/os";
|
import * as os from "@/os";
|
||||||
import { definePageMetadata } from "@/scripts/page-metadata";
|
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 | firefishJs.entities.UserDetailed>(null);
|
||||||
const error = ref(null);
|
const error = ref(null);
|
||||||
|
|
||||||
function fetchUser(): void {
|
function fetchUser(): void {
|
||||||
if (props.acct == null) return;
|
if (props.acct == null) return;
|
||||||
user.value = null;
|
user.value = null;
|
||||||
os.api("users/show", Acct.parse(props.acct))
|
os.api("users/show", firefishJs.acct.parse(props.acct))
|
||||||
.then((u) => {
|
.then((u) => {
|
||||||
user.value = u;
|
user.value = u;
|
||||||
})
|
})
|
||||||
|
|
|
@ -17,8 +17,7 @@
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, ref, watch } from "vue";
|
import { computed, ref, watch } from "vue";
|
||||||
import * as Acct from "firefish-js/built/acct";
|
import * as firefishJs from "firefish-js";
|
||||||
import type * as firefish from "firefish-js";
|
|
||||||
import XFollowList from "./follow-list.vue";
|
import XFollowList from "./follow-list.vue";
|
||||||
import * as os from "@/os";
|
import * as os from "@/os";
|
||||||
import { definePageMetadata } from "@/scripts/page-metadata";
|
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 | firefishJs.entities.UserDetailed>(null);
|
||||||
const error = ref(null);
|
const error = ref(null);
|
||||||
|
|
||||||
function fetchUser(): void {
|
function fetchUser(): void {
|
||||||
if (props.acct == null) return;
|
if (props.acct == null) return;
|
||||||
user.value = null;
|
user.value = null;
|
||||||
os.api("users/show", Acct.parse(props.acct))
|
os.api("users/show", firefishJs.acct.parse(props.acct))
|
||||||
.then((u) => {
|
.then((u) => {
|
||||||
user.value = u;
|
user.value = u;
|
||||||
})
|
})
|
||||||
|
|
|
@ -30,8 +30,7 @@
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, defineAsyncComponent, ref, watch } from "vue";
|
import { computed, defineAsyncComponent, ref, watch } from "vue";
|
||||||
import * as Acct from "firefish-js/built/acct";
|
import * as firefishJs from "firefish-js";
|
||||||
import type * as firefish from "firefish-js";
|
|
||||||
import { acct as getAcct } from "@/filters/user";
|
import { acct as getAcct } from "@/filters/user";
|
||||||
import * as os from "@/os";
|
import * as os from "@/os";
|
||||||
import { useRouter } from "@/router";
|
import { useRouter } from "@/router";
|
||||||
|
@ -59,13 +58,13 @@ const props = withDefaults(
|
||||||
useRouter();
|
useRouter();
|
||||||
|
|
||||||
const tab = ref(props.page);
|
const tab = ref(props.page);
|
||||||
const user = ref<null | firefish.entities.UserDetailed>(null);
|
const user = ref<null | firefishJs.entities.UserDetailed>(null);
|
||||||
const error = ref(null);
|
const error = ref(null);
|
||||||
|
|
||||||
function fetchUser(): void {
|
function fetchUser(): void {
|
||||||
if (props.acct == null) return;
|
if (props.acct == null) return;
|
||||||
user.value = null;
|
user.value = null;
|
||||||
os.api("users/show", Acct.parse(props.acct))
|
os.api("users/show", firefishJs.acct.parse(props.acct))
|
||||||
.then((u) => {
|
.then((u) => {
|
||||||
user.value = u;
|
user.value = u;
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import * as Acct from "firefish-js/built/acct";
|
import { acct } from "firefish-js";
|
||||||
import { host as localHost } from "@/config";
|
import { host as localHost } from "@/config";
|
||||||
|
|
||||||
export async function genSearchQuery(v: any, q: string) {
|
export async function genSearchQuery(v: any, q: string) {
|
||||||
|
@ -17,7 +17,7 @@ export async function genSearchQuery(v: any, q: string) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const user = await v.os
|
const user = await v.os
|
||||||
.api("users/show", Acct.parse(at))
|
.api("users/show", acct.parse(at))
|
||||||
.catch((x) => null);
|
.catch((x) => null);
|
||||||
if (user) {
|
if (user) {
|
||||||
userId = user.id;
|
userId = user.id;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import * as Acct from "firefish-js/built/acct";
|
import { acct } from "firefish-js";
|
||||||
import { defineAsyncComponent } from "vue";
|
import { defineAsyncComponent } from "vue";
|
||||||
import { $i, isModerator, isSignedIn } from "@/reactiveAccount";
|
import { $i, isModerator, isSignedIn } from "@/reactiveAccount";
|
||||||
import { host } from "@/config";
|
import { host } from "@/config";
|
||||||
|
@ -295,7 +295,7 @@ export function getUserMenu(user, router: Router = mainRouter) {
|
||||||
type: "link",
|
type: "link",
|
||||||
icon: `${icon("ph-chats-teardrop")}`,
|
icon: `${icon("ph-chats-teardrop")}`,
|
||||||
text: i18n.ts.startMessaging,
|
text: i18n.ts.startMessaging,
|
||||||
to: `/my/messaging/${Acct.toString(user)}`,
|
to: `/my/messaging/${acct.toString(user)}`,
|
||||||
}
|
}
|
||||||
: undefined,
|
: undefined,
|
||||||
user.host != null && user.url
|
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 { i18n } from "@/i18n";
|
||||||
import * as os from "@/os";
|
import * as os from "@/os";
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ export async function lookupUser() {
|
||||||
os.pageWindow(`/user-info/${user.id}`);
|
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 });
|
const idPromise = os.api("users/show", { userId: result });
|
||||||
let _notFound = false;
|
let _notFound = false;
|
||||||
const notFound = () => {
|
const notFound = () => {
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import type { DriveFile } from "firefish-js/built/entities";
|
import { entities } from "firefish-js";
|
||||||
import { ref } from "vue";
|
import { ref } from "vue";
|
||||||
import { i18n } from "@/i18n";
|
import { i18n } from "@/i18n";
|
||||||
import * as os from "@/os";
|
import * as os from "@/os";
|
||||||
|
@ -13,7 +13,7 @@ function select(
|
||||||
src: any,
|
src: any,
|
||||||
label: string | null,
|
label: string | null,
|
||||||
multiple: boolean,
|
multiple: boolean,
|
||||||
): Promise<DriveFile | DriveFile[]> {
|
): Promise<entities.DriveFile | entities.DriveFile[]> {
|
||||||
return new Promise((res, rej) => {
|
return new Promise((res, rej) => {
|
||||||
const keepOriginal = ref(defaultStore.state.keepOriginalUploading);
|
const keepOriginal = ref(defaultStore.state.keepOriginalUploading);
|
||||||
|
|
||||||
|
@ -124,13 +124,13 @@ function select(
|
||||||
export function selectFile(
|
export function selectFile(
|
||||||
src: any,
|
src: any,
|
||||||
label: string | null = null,
|
label: string | null = null,
|
||||||
): Promise<DriveFile> {
|
): Promise<entities.DriveFile> {
|
||||||
return select(src, label, false) as Promise<DriveFile>;
|
return select(src, label, false) as Promise<entities.DriveFile>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function selectFiles(
|
export function selectFiles(
|
||||||
src: any,
|
src: any,
|
||||||
label: string | null = null,
|
label: string | null = null,
|
||||||
): Promise<DriveFile[]> {
|
): Promise<entities.DriveFile[]> {
|
||||||
return select(src, label, true) as Promise<DriveFile[]>;
|
return select(src, label, true) as Promise<entities.DriveFile[]>;
|
||||||
}
|
}
|
||||||
|
|
|
@ -215,7 +215,7 @@
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, defineAsyncComponent, onMounted, provide, ref } from "vue";
|
import { computed, defineAsyncComponent, onMounted, provide, ref } from "vue";
|
||||||
import * as Acct from "firefish-js/built/acct";
|
import { acct } from "firefish-js";
|
||||||
import type { ComputedRef } from "vue";
|
import type { ComputedRef } from "vue";
|
||||||
import XCommon from "./_common_/common.vue";
|
import XCommon from "./_common_/common.vue";
|
||||||
import type { PageMetadata } from "@/scripts/page-metadata";
|
import type { PageMetadata } from "@/scripts/page-metadata";
|
||||||
|
@ -374,7 +374,7 @@ function messagingStart(ev) {
|
||||||
|
|
||||||
async function startUser(): void {
|
async function startUser(): void {
|
||||||
os.selectUser().then((user) => {
|
os.selectUser().then((user) => {
|
||||||
mainRouter.push(`/my/messaging/${Acct.toString(user)}`);
|
mainRouter.push(`/my/messaging/${acct.toString(user)}`);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,18 @@
|
||||||
import { Acct } from "./acct";
|
import * as acct from "./acct";
|
||||||
|
import type { Acct } from "./acct";
|
||||||
import { Endpoints } from "./api.types";
|
import { Endpoints } from "./api.types";
|
||||||
import * as consts from "./consts";
|
import * as consts from "./consts";
|
||||||
import Stream, { Connection } from "./streaming";
|
import Stream, { Connection } from "./streaming";
|
||||||
import { Channels } from "./streaming.types";
|
import * as StreamTypes from "./streaming.types";
|
||||||
|
|
||||||
export { Endpoints, Stream, Connection as ChannelConnection, Channels, Acct };
|
export {
|
||||||
|
Endpoints,
|
||||||
|
Stream,
|
||||||
|
Connection as ChannelConnection,
|
||||||
|
StreamTypes,
|
||||||
|
acct,
|
||||||
|
Acct,
|
||||||
|
};
|
||||||
|
|
||||||
export const permissions = consts.permissions;
|
export const permissions = consts.permissions;
|
||||||
export const notificationTypes = consts.notificationTypes;
|
export const notificationTypes = consts.notificationTypes;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { get } from "idb-keyval";
|
import { get } from "idb-keyval";
|
||||||
import * as Acct from "firefish-js/built/acct";
|
import { acct } from "firefish-js";
|
||||||
import type { PushNotificationDataMap } from "@/types";
|
import type { PushNotificationDataMap } from "@/types";
|
||||||
import {
|
import {
|
||||||
createEmptyNotification,
|
createEmptyNotification,
|
||||||
|
@ -119,7 +119,7 @@ globalThis.addEventListener("push", (ev) => {
|
||||||
case "showUser":
|
case "showUser":
|
||||||
if ("user" in data.body)
|
if ("user" in data.body)
|
||||||
client = await swos.openUser(
|
client = await swos.openUser(
|
||||||
Acct.toString(data.body.user),
|
acct.toString(data.body.user),
|
||||||
loginId,
|
loginId,
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
@ -178,7 +178,7 @@ globalThis.addEventListener("push", (ev) => {
|
||||||
client = await swos.openNote(data.body.note.id, loginId);
|
client = await swos.openNote(data.body.note.id, loginId);
|
||||||
} else if ("user" in data.body) {
|
} else if ("user" in data.body) {
|
||||||
client = await swos.openUser(
|
client = await swos.openUser(
|
||||||
Acct.toString(data.body.user),
|
acct.toString(data.body.user),
|
||||||
loginId,
|
loginId,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue