Merge branch 'develop' into acct-parse-url
This commit is contained in:
commit
a296eaf986
|
@ -56,6 +56,7 @@
|
|||
- Fix: ユーザーの前後ノートを閲覧する機能が動作しない問題を修正
|
||||
- Fix: 照会ダイアログでap/showでローカルユーザーを解決した際@username@nullに飛ばされる問題を修正
|
||||
- Fix: アイコンのデコレーションを付ける際にデコレーションが表示されなくなる問題を修正
|
||||
- Fix: 管理中アカウント一覧で正しい表示が行われない問題を修正
|
||||
|
||||
### Server
|
||||
- Feat: サーバー管理コマンド
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
*/
|
||||
|
||||
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import { StoryObj } from '@storybook/vue3';
|
||||
import { action } from 'storybook/actions';
|
||||
import type { StoryObj } from '@storybook/vue3';
|
||||
import { HttpResponse, http } from 'msw';
|
||||
import { abuseUserReport } from '../packages/frontend/.storybook/fakes.js';
|
||||
import { commonHandlers } from '../packages/frontend/.storybook/mocks.js';
|
||||
|
|
|
@ -12039,6 +12039,10 @@ export interface Locale extends ILocale {
|
|||
* 連合を行うと、継続して多くのコンテンツを受信します。自動クリーニングを有効にすると、参照されていない古くなったコンテンツを自動でサーバーから削除し、ストレージを節約できます。
|
||||
*/
|
||||
"remoteContentsCleaning_description": string;
|
||||
/**
|
||||
* ハイパーリンクなど、一部の参照方法はシステム上で検知できません。
|
||||
*/
|
||||
"remoteContentsCleaning_description2": string;
|
||||
/**
|
||||
* 管理者情報
|
||||
*/
|
||||
|
|
|
@ -3218,6 +3218,7 @@ _serverSetupWizard:
|
|||
youCanConfigureMoreFederationSettingsLater: "連合可能なサーバーの指定など、高度な設定も後ほど可能です。"
|
||||
remoteContentsCleaning: "受信コンテンツの自動クリーニング"
|
||||
remoteContentsCleaning_description: "連合を行うと、継続して多くのコンテンツを受信します。自動クリーニングを有効にすると、参照されていない古くなったコンテンツを自動でサーバーから削除し、ストレージを節約できます。"
|
||||
remoteContentsCleaning_description2: "ハイパーリンクなど、一部の参照方法はシステム上で検知できません。"
|
||||
adminInfo: "管理者情報"
|
||||
adminInfo_description: "問い合わせを受け付けるために使用される管理者情報を設定します。"
|
||||
adminInfo_mustBeFilled: "オープンサーバー、または連合がオンの場合は必ず入力が必要です。"
|
||||
|
|
|
@ -73,8 +73,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
updatedAt: new Date(),
|
||||
...Object.fromEntries(
|
||||
Object.entries(ps).filter(
|
||||
([key, val]) => (key !== 'flashId') && Object.hasOwn(paramDef.properties, key)
|
||||
)
|
||||
([key, val]) => (key !== 'flashId') && Object.hasOwn(paramDef.properties, key),
|
||||
),
|
||||
),
|
||||
});
|
||||
});
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
// TODO: (可能な部分を)sharedに抽出して frontend と共通化
|
||||
|
||||
import tinycolor from 'tinycolor2';
|
||||
import lightTheme from '@@/themes/_light.json5';
|
||||
import darkTheme from '@@/themes/_dark.json5';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
import { HttpResponse, http } from 'msw';
|
||||
import type { DefaultBodyType, HttpResponseResolver, JsonBodyType, PathParams } from 'msw';
|
||||
import seedrandom from 'seedrandom';
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import { action } from 'storybook/actions';
|
||||
|
||||
function getChartArray(seed: string, limit: number, option?: { accumulate?: boolean, mul?: number }): number[] {
|
||||
const rng = seedrandom(seed);
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
"prefix": "storyimplevent",
|
||||
"body": [
|
||||
"/* eslint-disable @typescript-eslint/explicit-function-return-type */",
|
||||
"import { action } from '@storybook/addon-actions';",
|
||||
"import { action } from 'storybook/actions';",
|
||||
"import { StoryObj } from '@storybook/vue3';",
|
||||
"import $1 from './$1.vue';",
|
||||
"export const Default = {",
|
||||
|
|
|
@ -83,7 +83,6 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@misskey-dev/summaly": "5.2.3",
|
||||
"@storybook/addon-actions": "9.0.8",
|
||||
"@storybook/addon-essentials": "8.6.14",
|
||||
"@storybook/addon-interactions": "8.6.14",
|
||||
"@storybook/addon-links": "9.1.3",
|
||||
|
|
|
@ -23,7 +23,7 @@ export async function getAccounts(): Promise<{
|
|||
host: string;
|
||||
id: Misskey.entities.User['id'];
|
||||
username: Misskey.entities.User['username'];
|
||||
user?: Misskey.entities.User | null;
|
||||
user?: Misskey.entities.MeDetailed | null;
|
||||
token: string | null;
|
||||
}[]> {
|
||||
const tokens = store.s.accountTokens;
|
||||
|
@ -38,7 +38,7 @@ export async function getAccounts(): Promise<{
|
|||
}));
|
||||
}
|
||||
|
||||
async function addAccount(host: string, user: Misskey.entities.User, token: AccountWithToken['token']) {
|
||||
async function addAccount(host: string, user: Misskey.entities.MeDetailed, token: AccountWithToken['token']) {
|
||||
if (!prefer.s.accounts.some(x => x[0] === host && x[1].id === user.id)) {
|
||||
store.set('accountTokens', { ...store.s.accountTokens, [host + '/' + user.id]: token });
|
||||
store.set('accountInfos', { ...store.s.accountInfos, [host + '/' + user.id]: user });
|
||||
|
@ -149,9 +149,10 @@ export function updateCurrentAccountPartial(accountData: Partial<Misskey.entitie
|
|||
|
||||
export async function refreshCurrentAccount() {
|
||||
if (!$i) return;
|
||||
const me = $i;
|
||||
return fetchAccount($i.token, $i.id).then(updateCurrentAccount).catch(reason => {
|
||||
if (reason === isAccountDeleted) {
|
||||
removeAccount(host, $i.id);
|
||||
removeAccount(host, me.id);
|
||||
if (Object.keys(store.s.accountTokens).length > 0) {
|
||||
login(Object.values(store.s.accountTokens)[0]);
|
||||
} else {
|
||||
|
@ -214,19 +215,37 @@ export async function openAccountMenu(opts: {
|
|||
includeCurrentAccount?: boolean;
|
||||
withExtraOperation: boolean;
|
||||
active?: Misskey.entities.User['id'];
|
||||
onChoose?: (account: Misskey.entities.User) => void;
|
||||
onChoose?: (account: Misskey.entities.MeDetailed) => void;
|
||||
}, ev: MouseEvent) {
|
||||
if (!$i) return;
|
||||
const me = $i;
|
||||
|
||||
function createItem(host: string, id: Misskey.entities.User['id'], username: Misskey.entities.User['username'], account: Misskey.entities.User | null | undefined, token: string): MenuItem {
|
||||
const callback = opts.onChoose;
|
||||
|
||||
function createItem(host: string, id: Misskey.entities.User['id'], username: Misskey.entities.User['username'], account: Misskey.entities.MeDetailed | null | undefined, token: string | null): MenuItem {
|
||||
if (account) {
|
||||
return {
|
||||
type: 'user' as const,
|
||||
user: account,
|
||||
active: opts.active != null ? opts.active === id : false,
|
||||
action: async () => {
|
||||
if (opts.onChoose) {
|
||||
opts.onChoose(account);
|
||||
if (callback) {
|
||||
callback(account);
|
||||
} else {
|
||||
switchAccount(host, id);
|
||||
}
|
||||
},
|
||||
};
|
||||
} else if (token != null) {
|
||||
return {
|
||||
type: 'button' as const,
|
||||
text: username,
|
||||
active: opts.active != null ? opts.active === id : false,
|
||||
action: async () => {
|
||||
if (callback) {
|
||||
fetchAccount(token, id).then(account => {
|
||||
callback(account);
|
||||
});
|
||||
} else {
|
||||
switchAccount(host, id);
|
||||
}
|
||||
|
@ -238,13 +257,7 @@ export async function openAccountMenu(opts: {
|
|||
text: username,
|
||||
active: opts.active != null ? opts.active === id : false,
|
||||
action: async () => {
|
||||
if (opts.onChoose) {
|
||||
fetchAccount(token, id).then(account => {
|
||||
opts.onChoose(account);
|
||||
});
|
||||
} else {
|
||||
switchAccount(host, id);
|
||||
}
|
||||
// TODO
|
||||
},
|
||||
};
|
||||
}
|
||||
|
@ -253,7 +266,7 @@ export async function openAccountMenu(opts: {
|
|||
const menuItems: MenuItem[] = [];
|
||||
|
||||
// TODO: $iのホストも比較したいけど通常null
|
||||
const accountItems = (await getAccounts().then(accounts => accounts.filter(x => x.id !== $i.id))).map(a => createItem(a.host, a.id, a.username, a.user, a.token));
|
||||
const accountItems = (await getAccounts().then(accounts => accounts.filter(x => x.id !== me.id))).map(a => createItem(a.host, a.id, a.username, a.user, a.token));
|
||||
|
||||
if (opts.withExtraOperation) {
|
||||
menuItems.push({
|
||||
|
|
|
@ -2,14 +2,13 @@
|
|||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import type { StoryObj } from '@storybook/vue3';
|
||||
|
||||
import { action } from 'storybook/actions';
|
||||
import { HttpResponse, http } from 'msw';
|
||||
import { userDetailed } from '../../.storybook/fakes.js';
|
||||
import { commonHandlers } from '../../.storybook/mocks.js';
|
||||
import MkAbuseReportWindow from './MkAbuseReportWindow.vue';
|
||||
import type { StoryObj } from '@storybook/vue3';
|
||||
export const Default = {
|
||||
render(args) {
|
||||
return {
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*/
|
||||
|
||||
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import { action } from 'storybook/actions';
|
||||
import type { StoryObj } from '@storybook/vue3';
|
||||
import { HttpResponse, http } from 'msw';
|
||||
import { commonHandlers } from '../../.storybook/mocks.js';
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*/
|
||||
|
||||
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import { action } from 'storybook/actions';
|
||||
import type { StoryObj } from '@storybook/vue3';
|
||||
import { HttpResponse, http } from 'msw';
|
||||
import { commonHandlers } from '../../.storybook/mocks.js';
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*/
|
||||
|
||||
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import { action } from 'storybook/actions';
|
||||
import type { StoryObj } from '@storybook/vue3';
|
||||
import { HttpResponse, http } from 'msw';
|
||||
import { commonHandlers } from '../../.storybook/mocks.js';
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*/
|
||||
|
||||
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import { action } from 'storybook/actions';
|
||||
import type { StoryObj } from '@storybook/vue3';
|
||||
import { HttpResponse, http } from 'msw';
|
||||
import { commonHandlers } from '../../.storybook/mocks.js';
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*/
|
||||
|
||||
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import { action } from 'storybook/actions';
|
||||
import { expect, userEvent, waitFor, within } from '@storybook/test';
|
||||
import type { StoryObj } from '@storybook/vue3';
|
||||
import { HttpResponse, http } from 'msw';
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
||||
/* eslint-disable import/no-default-export */
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import { action } from 'storybook/actions';
|
||||
import type { StoryObj } from '@storybook/vue3';
|
||||
import MkButton from './MkButton.vue';
|
||||
export const Default = {
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
|
||||
import { HttpResponse, http } from 'msw';
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import { action } from 'storybook/actions';
|
||||
import { expect, userEvent, within } from '@storybook/test';
|
||||
import { channel } from '../../.storybook/fakes.js';
|
||||
import { commonHandlers } from '../../.storybook/mocks.js';
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
/* eslint-disable import/no-default-export */
|
||||
import type { StoryObj } from '@storybook/vue3';
|
||||
import { HttpResponse, http } from 'msw';
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import { action } from 'storybook/actions';
|
||||
import { channel } from '../../.storybook/fakes.js';
|
||||
import { commonHandlers } from '../../.storybook/mocks.js';
|
||||
import MkChannelList from './MkChannelList.vue';
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*/
|
||||
|
||||
import { http, HttpResponse } from 'msw';
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import { action } from 'storybook/actions';
|
||||
import { chatMessage } from '../../.storybook/fakes';
|
||||
import MkChatHistories from './MkChatHistories.vue';
|
||||
import type { StoryObj } from '@storybook/vue3';
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
* SPDX-FileCopyrightText: syuilo and misskey-project
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
|
||||
import { HttpResponse, http } from 'msw';
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import { action } from 'storybook/actions';
|
||||
import { expect, userEvent, within } from '@storybook/test';
|
||||
import { commonHandlers } from '../../.storybook/mocks.js';
|
||||
import MkClickerGame from './MkClickerGame.vue';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
||||
/* eslint-disable import/no-default-export */
|
||||
import type { StoryObj } from '@storybook/vue3';
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import { action } from 'storybook/actions';
|
||||
import MkCodeEditor from './MkCodeEditor.vue';
|
||||
const code = `for (let i, 100) {
|
||||
<: if (i % 15 == 0) "FizzBuzz"
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
||||
/* eslint-disable import/no-default-export */
|
||||
import type { StoryObj } from '@storybook/vue3';
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import { action } from 'storybook/actions';
|
||||
import MkColorInput from './MkColorInput.vue';
|
||||
export const Default = {
|
||||
render(args) {
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*/
|
||||
|
||||
import { HttpResponse, http } from 'msw';
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import { action } from 'storybook/actions';
|
||||
import { file } from '../../.storybook/fakes.js';
|
||||
import { commonHandlers } from '../../.storybook/mocks.js';
|
||||
import MkCropperDialog from './MkCropperDialog.vue';
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
||||
/* eslint-disable import/no-default-export */
|
||||
import type { StoryObj } from '@storybook/vue3';
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import { action } from 'storybook/actions';
|
||||
import { expect, userEvent, within } from '@storybook/test';
|
||||
import { file } from '../../.storybook/fakes.js';
|
||||
import MkCwButton from './MkCwButton.vue';
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import { action } from 'storybook/actions';
|
||||
import { expect, userEvent, waitFor, within } from '@storybook/test';
|
||||
import type { StoryObj } from '@storybook/vue3';
|
||||
import { i18n } from '@/i18n.js';
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import { action } from 'storybook/actions';
|
||||
import type { StoryObj } from '@storybook/vue3';
|
||||
import { onBeforeUnmount } from 'vue';
|
||||
import MkDonation from './MkDonation.vue';
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import { action } from 'storybook/actions';
|
||||
import type { StoryObj } from '@storybook/vue3';
|
||||
import MkDrive_file from './MkDrive.file.vue';
|
||||
import { file } from '../../.storybook/fakes.js';
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import { action } from 'storybook/actions';
|
||||
import type { StoryObj } from '@storybook/vue3';
|
||||
import { http, HttpResponse } from 'msw';
|
||||
import * as Misskey from 'misskey-js';
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import { action } from 'storybook/actions';
|
||||
import type { StoryObj } from '@storybook/vue3';
|
||||
import { http, HttpResponse } from 'msw';
|
||||
import * as Misskey from 'misskey-js';
|
||||
|
|
|
@ -293,7 +293,7 @@ function onDragleave() {
|
|||
draghover.value = false;
|
||||
}
|
||||
|
||||
function onDrop(ev: DragEvent) {
|
||||
function onDrop(ev: DragEvent): void | boolean {
|
||||
draghover.value = false;
|
||||
|
||||
if (!ev.dataTransfer) return;
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import { action } from 'storybook/actions';
|
||||
import { expect, userEvent, waitFor, within } from '@storybook/test';
|
||||
import type { StoryObj } from '@storybook/vue3';
|
||||
import { i18n } from '@/i18n.js';
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
import { StoryObj } from '@storybook/vue3';
|
||||
import type { StoryObj } from '@storybook/vue3';
|
||||
import { file } from '../../.storybook/fakes.js';
|
||||
import MkImgPreviewDialog from './MkImgPreviewDialog.vue';
|
||||
export const Default = {
|
||||
|
|
|
@ -39,10 +39,12 @@ const el = ref<HTMLElement | { $el: HTMLElement }>();
|
|||
|
||||
if (isEnabledUrlPreview.value) {
|
||||
useTooltip(el, (showing) => {
|
||||
const anchorElement = el.value instanceof HTMLElement ? el.value : el.value?.$el;
|
||||
if (anchorElement == null) return;
|
||||
const { dispose } = os.popup(defineAsyncComponent(() => import('@/components/MkUrlPreviewPopup.vue')), {
|
||||
showing,
|
||||
url: props.url,
|
||||
anchorElement: el.value instanceof HTMLElement ? el.value : el.value?.$el,
|
||||
anchorElement: anchorElement,
|
||||
}, {
|
||||
closed: () => dispose(),
|
||||
});
|
||||
|
|
|
@ -654,7 +654,7 @@ function showRenoteMenu(): void {
|
|||
getCopyNoteLinkMenu(note, i18n.ts.copyLinkRenote),
|
||||
{ type: 'divider' },
|
||||
getAbuseNoteMenu(note, i18n.ts.reportAbuseRenote),
|
||||
($i?.isModerator || $i?.isAdmin) ? getUnrenote() : undefined,
|
||||
...(($i?.isModerator || $i?.isAdmin) ? [getUnrenote()] : []),
|
||||
], renoteTime.value);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -392,6 +392,9 @@ const reactionsPaginator = markRaw(new Paginator('notes/reactions', {
|
|||
}));
|
||||
|
||||
useTooltip(renoteButton, async (showing) => {
|
||||
const anchorElement = renoteButton.value;
|
||||
if (anchorElement == null) return;
|
||||
|
||||
const renotes = await misskeyApi('notes/renotes', {
|
||||
noteId: appearNote.id,
|
||||
limit: 11,
|
||||
|
@ -405,7 +408,7 @@ useTooltip(renoteButton, async (showing) => {
|
|||
showing,
|
||||
users,
|
||||
count: appearNote.renoteCount,
|
||||
anchorElement: renoteButton.value,
|
||||
anchorElement: anchorElement,
|
||||
}, {
|
||||
closed: () => dispose(),
|
||||
});
|
||||
|
|
|
@ -57,7 +57,7 @@ async function _close() {
|
|||
modal.value?.close();
|
||||
}
|
||||
|
||||
function onEsc(ev: KeyboardEvent) {
|
||||
function onEsc() {
|
||||
_close();
|
||||
}
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
|
||||
<MkSwitch v-if="q_federation === 'yes'" v-model="q_remoteContentsCleaning">
|
||||
<template #label>{{ i18n.ts._serverSetupWizard.remoteContentsCleaning }}</template>
|
||||
<template #caption>{{ i18n.ts._serverSetupWizard.remoteContentsCleaning_description }}</template>
|
||||
<template #caption>{{ i18n.ts._serverSetupWizard.remoteContentsCleaning_description }} ({{ i18n.ts._serverSetupWizard.remoteContentsCleaning_description2 }})</template>
|
||||
</MkSwitch>
|
||||
</div>
|
||||
</MkFolder>
|
||||
|
|
|
@ -39,17 +39,10 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
export type Tab = {
|
||||
key: string;
|
||||
onClick?: (ev: MouseEvent) => void;
|
||||
} & (
|
||||
| {
|
||||
iconOnly?: false;
|
||||
title: string;
|
||||
icon?: string;
|
||||
}
|
||||
| {
|
||||
iconOnly: true;
|
||||
icon: string;
|
||||
}
|
||||
);
|
||||
iconOnly?: boolean;
|
||||
title: string;
|
||||
icon?: string;
|
||||
};
|
||||
</script>
|
||||
|
||||
<script lang="ts" setup>
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
||||
/* eslint-disable import/no-default-export */
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import { action } from 'storybook/actions';
|
||||
import type { StoryObj } from '@storybook/vue3';
|
||||
import MkTagItem from './MkTagItem.vue';
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*/
|
||||
|
||||
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import { action } from 'storybook/actions';
|
||||
import { expect, waitFor } from '@storybook/test';
|
||||
import type { StoryObj } from '@storybook/vue3';
|
||||
import MkError from './MkError.vue';
|
||||
|
|
|
@ -39,17 +39,10 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
export type Tab = {
|
||||
key: string;
|
||||
onClick?: (ev: MouseEvent) => void;
|
||||
} & (
|
||||
| {
|
||||
iconOnly?: false;
|
||||
title: string;
|
||||
icon?: string;
|
||||
}
|
||||
| {
|
||||
iconOnly: true;
|
||||
icon: string;
|
||||
}
|
||||
);
|
||||
iconOnly?: boolean;
|
||||
title: string;
|
||||
icon?: string;
|
||||
};
|
||||
</script>
|
||||
|
||||
<script lang="ts" setup>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*/
|
||||
|
||||
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import { action } from 'storybook/actions';
|
||||
import type { StoryObj } from '@storybook/vue3';
|
||||
import { ref } from 'vue';
|
||||
import { commonHandlers } from '../../../.storybook/mocks.js';
|
||||
|
|
|
@ -684,7 +684,7 @@ export async function cropImageFile(imageFile: File | Blob, options: {
|
|||
});
|
||||
}
|
||||
|
||||
export function popupMenu(items: MenuItem[], anchorElement?: HTMLElement | EventTarget | null, options?: {
|
||||
export function popupMenu(items: (MenuItem | null)[], anchorElement?: HTMLElement | EventTarget | null, options?: {
|
||||
align?: string;
|
||||
width?: number;
|
||||
onClosing?: () => void;
|
||||
|
@ -696,7 +696,7 @@ export function popupMenu(items: MenuItem[], anchorElement?: HTMLElement | Event
|
|||
let returnFocusTo = getHTMLElementOrNull(anchorElement) ?? getHTMLElementOrNull(window.document.activeElement);
|
||||
return new Promise(resolve => nextTick(() => {
|
||||
const { dispose } = popup(MkPopupMenu, {
|
||||
items,
|
||||
items: items.filter(x => x != null),
|
||||
anchorElement,
|
||||
width: options?.width,
|
||||
align: options?.align,
|
||||
|
|
|
@ -26,7 +26,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
</div>
|
||||
</MkFoldableSection>
|
||||
|
||||
<MkFoldableSection v-for="category in customEmojiCategories" v-once :key="category">
|
||||
<MkFoldableSection v-for="category in customEmojiCategories" v-once :key="category ?? '___root___'">
|
||||
<template #header>{{ category || i18n.ts.other }}</template>
|
||||
<div :class="$style.emojis">
|
||||
<XEmoji v-for="emoji in customEmojis.filter(e => e.category === category)" :key="emoji.name" :emoji="emoji"/>
|
||||
|
|
|
@ -7,7 +7,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<div class="_gaps_m">
|
||||
<div :class="$style.banner" :style="{ backgroundImage: `url(${ instance.bannerUrl })` }">
|
||||
<div style="overflow: clip;">
|
||||
<img :src="instance.iconUrl ?? instance.faviconUrl ?? '/favicon.ico'" alt="" :class="$style.bannerIcon"/>
|
||||
<img :src="instance.iconUrl ?? '/favicon.ico'" alt="" :class="$style.bannerIcon"/>
|
||||
<div :class="$style.bannerName">
|
||||
<b>{{ instance.name ?? host }}</b>
|
||||
</div>
|
||||
|
|
|
@ -172,7 +172,7 @@ const headerTabs = computed(() => [{
|
|||
key: 'raw',
|
||||
title: 'Raw data',
|
||||
icon: 'ti ti-code',
|
||||
}]);
|
||||
}].filter(x => x != null));
|
||||
|
||||
definePage(() => ({
|
||||
title: file.value ? `${i18n.ts.file}: ${file.value.name}` : i18n.ts.file,
|
||||
|
|
|
@ -25,11 +25,19 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
</SearchMarker>
|
||||
|
||||
<SearchMarker :keywords="['ugc', 'content', 'visibility', 'visitor', 'guest']">
|
||||
<MkSelect v-model="ugcVisibilityForVisitor" @update:modelValue="onChange_ugcVisibilityForVisitor">
|
||||
<MkSelect
|
||||
v-model="ugcVisibilityForVisitor" :items="[{
|
||||
value: 'all',
|
||||
label: i18n.ts._serverSettings._userGeneratedContentsVisibilityForVisitor.all,
|
||||
}, {
|
||||
value: 'local',
|
||||
label: i18n.ts._serverSettings._userGeneratedContentsVisibilityForVisitor.localOnly + ' (' + i18n.ts.recommended + ')',
|
||||
}, {
|
||||
value: 'none',
|
||||
label: i18n.ts._serverSettings._userGeneratedContentsVisibilityForVisitor.none,
|
||||
}] as const" @update:modelValue="onChange_ugcVisibilityForVisitor"
|
||||
>
|
||||
<template #label><SearchLabel>{{ i18n.ts._serverSettings.userGeneratedContentsVisibilityForVisitor }}</SearchLabel></template>
|
||||
<option value="all">{{ i18n.ts._serverSettings._userGeneratedContentsVisibilityForVisitor.all }}</option>
|
||||
<option value="local">{{ i18n.ts._serverSettings._userGeneratedContentsVisibilityForVisitor.localOnly }} ({{ i18n.ts.recommended }})</option>
|
||||
<option value="none">{{ i18n.ts._serverSettings._userGeneratedContentsVisibilityForVisitor.none }}</option>
|
||||
<template #caption>
|
||||
<div><SearchText>{{ i18n.ts._serverSettings.userGeneratedContentsVisibilityForVisitor_description }}</SearchText></div>
|
||||
<div><i class="ti ti-alert-triangle" style="color: var(--MI_THEME-warn);"></i> <SearchText>{{ i18n.ts._serverSettings.userGeneratedContentsVisibilityForVisitor_description2 }}</SearchText></div>
|
||||
|
@ -158,6 +166,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { ref, computed } from 'vue';
|
||||
import * as Misskey from 'misskey-js';
|
||||
import XServerRules from './server-rules.vue';
|
||||
import MkSwitch from '@/components/MkSwitch.vue';
|
||||
import MkInput from '@/components/MkInput.vue';
|
||||
|
@ -212,7 +221,7 @@ function onChange_emailRequiredForSignup(value: boolean) {
|
|||
});
|
||||
}
|
||||
|
||||
function onChange_ugcVisibilityForVisitor(value: string) {
|
||||
function onChange_ugcVisibilityForVisitor(value: Misskey.entities.AdminUpdateMetaRequest['ugcVisibilityForVisitor']) {
|
||||
os.apiWithDialog('admin/update-meta', {
|
||||
ugcVisibilityForVisitor: value,
|
||||
}).then(() => {
|
||||
|
|
|
@ -77,7 +77,7 @@ paginator.init();
|
|||
const timeline = computed(() => {
|
||||
return paginator.items.value.map(x => ({
|
||||
id: x.id,
|
||||
timestamp: x.createdAt,
|
||||
timestamp: new Date(x.createdAt).getTime(),
|
||||
data: x,
|
||||
}));
|
||||
});
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
import type { StoryObj } from '@storybook/vue3';
|
||||
import { http, HttpResponse } from 'msw';
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import { action } from 'storybook/actions';
|
||||
import { commonHandlers } from '../../../.storybook/mocks.js';
|
||||
import overview_ap_requests from './overview.ap-requests.vue';
|
||||
export const Default = {
|
||||
|
|
|
@ -383,7 +383,7 @@ if (props.id) {
|
|||
|
||||
const title = ref(flash.value?.title ?? 'New Play');
|
||||
const summary = ref(flash.value?.summary ?? '');
|
||||
const permissions = ref(flash.value?.permissions ?? []);
|
||||
const permissions = ref([]); // not implemented yet
|
||||
const visibility = ref<'private' | 'public'>(flash.value?.visibility ?? 'public');
|
||||
const script = ref(flash.value?.script ?? PRESET_DEFAULT);
|
||||
|
||||
|
@ -412,9 +412,9 @@ function selectPreset(ev: MouseEvent) {
|
|||
}
|
||||
|
||||
async function save() {
|
||||
if (flash.value) {
|
||||
if (flash.value != null) {
|
||||
os.apiWithDialog('flash/update', {
|
||||
flashId: props.id,
|
||||
flashId: flash.value.id,
|
||||
title: title.value,
|
||||
summary: summary.value,
|
||||
permissions: permissions.value,
|
||||
|
@ -448,6 +448,8 @@ function show() {
|
|||
}
|
||||
|
||||
async function del() {
|
||||
if (flash.value == null) return;
|
||||
|
||||
const { canceled } = await os.confirm({
|
||||
type: 'warning',
|
||||
text: i18n.tsx.deleteAreYouSure({ x: flash.value.title }),
|
||||
|
@ -455,7 +457,7 @@ async function del() {
|
|||
if (canceled) return;
|
||||
|
||||
await os.apiWithDialog('flash/delete', {
|
||||
flashId: props.id,
|
||||
flashId: flash.value.id,
|
||||
});
|
||||
router.push('/play');
|
||||
}
|
||||
|
@ -468,6 +470,7 @@ definePage(() => ({
|
|||
title: flash.value ? `${i18n.ts._play.edit}: ${flash.value.title}` : i18n.ts._play.new,
|
||||
}));
|
||||
</script>
|
||||
|
||||
<style lang="scss" module>
|
||||
.footer {
|
||||
backdrop-filter: var(--MI-blur, blur(15px));
|
||||
|
|
|
@ -11,7 +11,9 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<!--<MkButton @click="refreshAllAccounts"><i class="ti ti-refresh"></i></MkButton>-->
|
||||
</div>
|
||||
|
||||
<MkUserCardMini v-for="x in accounts" :key="x[0] + x[1].id" :user="x[1]" :class="$style.user" @click.prevent="showMenu(x[0], x[1], $event)"/>
|
||||
<template v-for="x in accounts" :key="x.host + x.id">
|
||||
<MkUserCardMini v-if="x.user" :user="x.user" :class="$style.user" @click.prevent="showMenu(x.host, x.id, $event)"/>
|
||||
</template>
|
||||
</div>
|
||||
</SearchMarker>
|
||||
</template>
|
||||
|
@ -24,29 +26,29 @@ import MkButton from '@/components/MkButton.vue';
|
|||
import * as os from '@/os.js';
|
||||
import { misskeyApi } from '@/utility/misskey-api.js';
|
||||
import { $i } from '@/i.js';
|
||||
import { switchAccount, removeAccount, login, getAccountWithSigninDialog, getAccountWithSignupDialog } from '@/accounts.js';
|
||||
import { switchAccount, removeAccount, login, getAccountWithSigninDialog, getAccountWithSignupDialog, getAccounts } from '@/accounts.js';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import { definePage } from '@/page.js';
|
||||
import MkUserCardMini from '@/components/MkUserCardMini.vue';
|
||||
import { prefer } from '@/preferences.js';
|
||||
|
||||
const accounts = prefer.r.accounts;
|
||||
const accounts = await getAccounts();
|
||||
|
||||
function refreshAllAccounts() {
|
||||
// TODO
|
||||
}
|
||||
|
||||
function showMenu(host: string, account: Misskey.entities.UserDetailed, ev: MouseEvent) {
|
||||
function showMenu(host: string, id: string, ev: MouseEvent) {
|
||||
let menu: MenuItem[];
|
||||
|
||||
menu = [{
|
||||
text: i18n.ts.switch,
|
||||
icon: 'ti ti-switch-horizontal',
|
||||
action: () => switchAccount(host, account.id),
|
||||
action: () => switchAccount(host, id),
|
||||
}, {
|
||||
text: i18n.ts.remove,
|
||||
icon: 'ti ti-trash',
|
||||
action: () => removeAccount(host, account.id),
|
||||
action: () => removeAccount(host, id),
|
||||
}];
|
||||
|
||||
os.popupMenu(menu, ev.currentTarget ?? ev.target);
|
||||
|
|
|
@ -1031,7 +1031,6 @@ function testNotification(): void {
|
|||
const notification: Misskey.entities.Notification = {
|
||||
id: genId(),
|
||||
createdAt: new Date().toUTCString(),
|
||||
isRead: false,
|
||||
type: 'test',
|
||||
};
|
||||
|
||||
|
|
|
@ -106,7 +106,7 @@ export const store = markRaw(new Pizzax('base', {
|
|||
},
|
||||
accountInfos: {
|
||||
where: 'device',
|
||||
default: {} as Record<string, Misskey.entities.User>, // host/userId, user
|
||||
default: {} as Record<string, Misskey.entities.MeDetailed>, // host/userId, user
|
||||
},
|
||||
|
||||
enablePreferencesAutoCloudBackup: {
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
// TODO: (可能な部分を)sharedに抽出して frontend-embed と共通化
|
||||
|
||||
import { ref, nextTick } from 'vue';
|
||||
import tinycolor from 'tinycolor2';
|
||||
import lightTheme from '@@/themes/_light.json5';
|
||||
|
@ -166,16 +168,21 @@ export function compile(theme: Theme): Record<string, string> {
|
|||
return getColor(theme.props[val]);
|
||||
} else if (val[0] === ':') { // func
|
||||
const parts = val.split('<');
|
||||
const func = parts.shift().substring(1);
|
||||
const arg = parseFloat(parts.shift());
|
||||
const color = getColor(parts.join('<'));
|
||||
const funcTxt = parts.shift();
|
||||
const argTxt = parts.shift();
|
||||
|
||||
switch (func) {
|
||||
case 'darken': return color.darken(arg);
|
||||
case 'lighten': return color.lighten(arg);
|
||||
case 'alpha': return color.setAlpha(arg);
|
||||
case 'hue': return color.spin(arg);
|
||||
case 'saturate': return color.saturate(arg);
|
||||
if (funcTxt && argTxt) {
|
||||
const func = funcTxt.substring(1);
|
||||
const arg = parseFloat(argTxt);
|
||||
const color = getColor(parts.join('<'));
|
||||
|
||||
switch (func) {
|
||||
case 'darken': return color.darken(arg);
|
||||
case 'lighten': return color.lighten(arg);
|
||||
case 'alpha': return color.setAlpha(arg);
|
||||
case 'hue': return color.spin(arg);
|
||||
case 'saturate': return color.saturate(arg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ export type MenuAction = (ev: MouseEvent) => void;
|
|||
export interface MenuButton {
|
||||
type?: 'button';
|
||||
text: Text;
|
||||
caption?: Text;
|
||||
caption?: Text | null | undefined | ComputedRef<null | undefined>;
|
||||
icon?: string;
|
||||
indicate?: boolean;
|
||||
danger?: boolean;
|
||||
|
@ -38,14 +38,14 @@ export interface MenuDivider extends MenuBase {
|
|||
export interface MenuLabel extends MenuBase {
|
||||
type: 'label';
|
||||
text: Text;
|
||||
caption?: Text;
|
||||
caption?: Text | null | undefined | ComputedRef<null | undefined>;
|
||||
}
|
||||
|
||||
export interface MenuLink extends MenuBase {
|
||||
type: 'link';
|
||||
to: string;
|
||||
text: Text;
|
||||
caption?: Text;
|
||||
caption?: Text | null | undefined | ComputedRef<null | undefined>;
|
||||
icon?: string;
|
||||
indicate?: boolean;
|
||||
avatar?: Misskey.entities.User;
|
||||
|
@ -57,7 +57,7 @@ export interface MenuA extends MenuBase {
|
|||
target?: string;
|
||||
download?: string;
|
||||
text: Text;
|
||||
caption?: Text;
|
||||
caption?: Text | null | undefined | ComputedRef<null | undefined>;
|
||||
icon?: string;
|
||||
indicate?: boolean;
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ export interface MenuSwitch extends MenuBase {
|
|||
type: 'switch';
|
||||
ref: Ref<boolean>;
|
||||
text: Text;
|
||||
caption?: Text;
|
||||
caption?: Text | null | undefined | ComputedRef<null | undefined>;
|
||||
icon?: string;
|
||||
disabled?: boolean | Ref<boolean>;
|
||||
}
|
||||
|
@ -82,7 +82,7 @@ export interface MenuSwitch extends MenuBase {
|
|||
export interface MenuRadio extends MenuBase {
|
||||
type: 'radio';
|
||||
text: Text;
|
||||
caption?: Text;
|
||||
caption?: Text | null | undefined | ComputedRef<null | undefined>;
|
||||
icon?: string;
|
||||
ref: Ref<MenuRadioOptionsDef[keyof MenuRadioOptionsDef]>;
|
||||
options: MenuRadioOptionsDef;
|
||||
|
@ -92,7 +92,7 @@ export interface MenuRadio extends MenuBase {
|
|||
export interface MenuRadioOption extends MenuBase {
|
||||
type: 'radioOption';
|
||||
text: Text;
|
||||
caption?: Text;
|
||||
caption?: Text | null | undefined | ComputedRef<null | undefined>;
|
||||
action: MenuAction;
|
||||
active?: boolean | ComputedRef<boolean>;
|
||||
}
|
||||
|
@ -106,7 +106,7 @@ export interface MenuComponent<T extends Component = any> extends MenuBase {
|
|||
export interface MenuParent extends MenuBase {
|
||||
type: 'parent';
|
||||
text: Text;
|
||||
caption?: Text;
|
||||
caption?: Text | null | undefined | ComputedRef<null | undefined>;
|
||||
icon?: string;
|
||||
children: MenuItem[] | (() => Promise<MenuItem[]> | MenuItem[]);
|
||||
}
|
||||
|
|
|
@ -8,7 +8,14 @@ import * as Misskey from 'misskey-js';
|
|||
export interface PostFormProps {
|
||||
reply?: Misskey.entities.Note | null;
|
||||
renote?: Misskey.entities.Note | null;
|
||||
channel?: Misskey.entities.Channel | null; // TODO
|
||||
channel?: {
|
||||
id: string;
|
||||
name: string;
|
||||
color: string;
|
||||
isSensitive: boolean;
|
||||
allowRenoteToExternal: boolean;
|
||||
userId: string | null;
|
||||
} | null;
|
||||
mention?: Misskey.entities.User;
|
||||
specified?: Misskey.entities.UserDetailed;
|
||||
initialText?: string;
|
||||
|
|
|
@ -8,7 +8,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<div class="body">
|
||||
<div class="left">
|
||||
<button v-click-anime class="item _button instance" @click="openInstanceMenu">
|
||||
<img :src="instance.iconUrl ?? instance.faviconUrl ?? '/favicon.ico'" draggable="false"/>
|
||||
<img :src="instance.iconUrl ?? '/favicon.ico'" draggable="false"/>
|
||||
</button>
|
||||
<MkA v-click-anime v-tooltip="i18n.ts.timeline" class="item index" activeClass="active" to="/" exact>
|
||||
<i class="ti ti-home ti-fw"></i>
|
||||
|
@ -21,7 +21,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
</component>
|
||||
</template>
|
||||
<div class="divider"></div>
|
||||
<MkA v-if="$i.isAdmin || $i.isModerator" v-click-anime v-tooltip="i18n.ts.controlPanel" class="item" activeClass="active" to="/admin" :behavior="settingsWindowed ? 'window' : null">
|
||||
<MkA v-if="$i && ($i.isAdmin || $i.isModerator)" v-click-anime v-tooltip="i18n.ts.controlPanel" class="item" activeClass="active" to="/admin" :behavior="settingsWindowed ? 'window' : null">
|
||||
<i class="ti ti-dashboard ti-fw"></i>
|
||||
</MkA>
|
||||
<button v-click-anime class="item _button" @click="more">
|
||||
|
@ -33,7 +33,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
<MkA v-click-anime v-tooltip="i18n.ts.settings" class="item" activeClass="active" to="/settings" :behavior="settingsWindowed ? 'window' : null">
|
||||
<i class="ti ti-settings ti-fw"></i>
|
||||
</MkA>
|
||||
<button v-click-anime class="item _button account" @click="openAccountMenu">
|
||||
<button v-if="$i" v-click-anime class="item _button account" @click="openAccountMenu">
|
||||
<MkAvatar :user="$i" class="avatar"/><MkAcct class="acct" :user="$i"/>
|
||||
</button>
|
||||
<div class="post" @click="os.post()">
|
||||
|
|
|
@ -233,7 +233,7 @@ function select(anchorElement: HTMLElement | EventTarget | null, label: string |
|
|||
os.popupMenu([label ? {
|
||||
text: label,
|
||||
type: 'label',
|
||||
} : undefined, {
|
||||
} : null, {
|
||||
text: i18n.ts.upload,
|
||||
icon: 'ti ti-upload',
|
||||
action: () => chooseFileFromPcAndUpload({ multiple, features }).then(files => res(files)),
|
||||
|
|
|
@ -13,7 +13,7 @@ const removeHash = (x: string) => x.replace(/#[^#]*$/, '');
|
|||
export function extractUrlFromMfm(nodes: mfm.MfmNode[], respectSilentFlag = true): string[] {
|
||||
const urlNodes = mfm.extract(nodes, (node) => {
|
||||
return (node.type === 'url') || (node.type === 'link' && (!respectSilentFlag || !node.props.silent));
|
||||
});
|
||||
}) as mfm.MfmUrl[];
|
||||
const urls: string[] = unique(urlNodes.map(x => x.props.url));
|
||||
|
||||
return urls.reduce((array, url) => {
|
||||
|
|
|
@ -29,8 +29,8 @@ export function calcPopupPosition(el: HTMLElement, props: {
|
|||
left = rect.left + window.scrollX + (props.anchorElement.offsetWidth / 2);
|
||||
top = (rect.top + window.scrollY - contentHeight) - props.innerMargin;
|
||||
} else {
|
||||
left = props.x;
|
||||
top = (props.y - contentHeight) - props.innerMargin;
|
||||
left = props.x!;
|
||||
top = (props.y! - contentHeight) - props.innerMargin;
|
||||
}
|
||||
|
||||
left -= (el.offsetWidth / 2);
|
||||
|
@ -54,8 +54,8 @@ export function calcPopupPosition(el: HTMLElement, props: {
|
|||
left = rect.left + window.scrollX + (props.anchorElement.offsetWidth / 2);
|
||||
top = (rect.top + window.scrollY + props.anchorElement.offsetHeight) + props.innerMargin;
|
||||
} else {
|
||||
left = props.x;
|
||||
top = (props.y) + props.innerMargin;
|
||||
left = props.x!;
|
||||
top = (props.y!) + props.innerMargin;
|
||||
}
|
||||
|
||||
left -= (el.offsetWidth / 2);
|
||||
|
@ -79,8 +79,8 @@ export function calcPopupPosition(el: HTMLElement, props: {
|
|||
left = (rect.left + window.scrollX - contentWidth) - props.innerMargin;
|
||||
top = rect.top + window.scrollY + (props.anchorElement.offsetHeight / 2);
|
||||
} else {
|
||||
left = (props.x - contentWidth) - props.innerMargin;
|
||||
top = props.y;
|
||||
left = (props.x! - contentWidth) - props.innerMargin;
|
||||
top = props.y!;
|
||||
}
|
||||
|
||||
top -= (el.offsetHeight / 2);
|
||||
|
@ -97,8 +97,8 @@ export function calcPopupPosition(el: HTMLElement, props: {
|
|||
};
|
||||
|
||||
const calcPosWhenRight = () => {
|
||||
let left: number;
|
||||
let top: number;
|
||||
let left = 0; // TSを黙らすためとりあえず初期値を0に
|
||||
let top = 0; // TSを黙らすためとりあえず初期値を0に
|
||||
|
||||
if (props.anchorElement) {
|
||||
left = (rect.left + props.anchorElement.offsetWidth + window.scrollX) + props.innerMargin;
|
||||
|
@ -113,8 +113,8 @@ export function calcPopupPosition(el: HTMLElement, props: {
|
|||
top -= (el.offsetHeight / 2);
|
||||
}
|
||||
} else {
|
||||
left = props.x + props.innerMargin;
|
||||
top = props.y;
|
||||
left = props.x! + props.innerMargin;
|
||||
top = props.y!;
|
||||
top -= (el.offsetHeight / 2);
|
||||
}
|
||||
|
||||
|
|
|
@ -899,9 +899,6 @@ importers:
|
|||
'@misskey-dev/summaly':
|
||||
specifier: 5.2.3
|
||||
version: 5.2.3
|
||||
'@storybook/addon-actions':
|
||||
specifier: 9.0.8
|
||||
version: 9.0.8
|
||||
'@storybook/addon-essentials':
|
||||
specifier: 8.6.14
|
||||
version: 8.6.14(@types/react@18.0.28)(storybook@9.1.3(@testing-library/dom@10.4.0)(bufferutil@4.0.9)(msw@2.10.5(@types/node@22.17.2)(typescript@5.9.2))(prettier@3.6.2)(utf-8-validate@6.0.5)(vite@7.1.3(@types/node@22.17.2)(sass@1.90.0)(terser@5.43.1)(tsx@4.20.4)))
|
||||
|
@ -4152,9 +4149,6 @@ packages:
|
|||
peerDependencies:
|
||||
storybook: ^8.6.14
|
||||
|
||||
'@storybook/addon-actions@9.0.8':
|
||||
resolution: {integrity: sha512-LFePu7PPnWN0Il/uoUpmA5T0J0C7d6haJIbg0pXrjxW2MQVSYXE4S4LSUz8fOImltBDV3xAl6tLPYHFj6VcrOA==}
|
||||
|
||||
'@storybook/addon-backgrounds@8.6.14':
|
||||
resolution: {integrity: sha512-l9xS8qWe5n4tvMwth09QxH2PmJbCctEvBAc1tjjRasAfrd69f7/uFK4WhwJAstzBTNgTc8VXI4w8ZR97i1sFbg==}
|
||||
peerDependencies:
|
||||
|
@ -11988,7 +11982,7 @@ snapshots:
|
|||
'@babel/traverse': 7.24.7
|
||||
'@babel/types': 7.28.1
|
||||
convert-source-map: 2.0.0
|
||||
debug: 4.4.1(supports-color@10.2.0)
|
||||
debug: 4.4.1(supports-color@5.5.0)
|
||||
gensync: 1.0.0-beta.2
|
||||
json5: 2.2.3
|
||||
semver: 6.3.1
|
||||
|
@ -12163,7 +12157,7 @@ snapshots:
|
|||
'@babel/helper-split-export-declaration': 7.24.7
|
||||
'@babel/parser': 7.28.0
|
||||
'@babel/types': 7.28.1
|
||||
debug: 4.4.1(supports-color@10.2.0)
|
||||
debug: 4.4.1(supports-color@5.5.0)
|
||||
globals: 11.12.0
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
@ -12503,7 +12497,7 @@ snapshots:
|
|||
'@eslint/config-array@0.21.0':
|
||||
dependencies:
|
||||
'@eslint/object-schema': 2.1.6
|
||||
debug: 4.4.1(supports-color@10.2.0)
|
||||
debug: 4.4.1(supports-color@5.5.0)
|
||||
minimatch: 3.1.2
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
@ -12517,7 +12511,7 @@ snapshots:
|
|||
'@eslint/eslintrc@3.3.1':
|
||||
dependencies:
|
||||
ajv: 6.12.6
|
||||
debug: 4.4.1(supports-color@10.2.0)
|
||||
debug: 4.4.1(supports-color@5.5.0)
|
||||
espree: 10.4.0
|
||||
globals: 14.0.0
|
||||
ignore: 5.3.1
|
||||
|
@ -14607,8 +14601,6 @@ snapshots:
|
|||
storybook: 9.1.3(@testing-library/dom@10.4.0)(bufferutil@4.0.9)(msw@2.10.5(@types/node@22.17.2)(typescript@5.9.2))(prettier@3.6.2)(utf-8-validate@6.0.5)(vite@7.1.3(@types/node@22.17.2)(sass@1.90.0)(terser@5.43.1)(tsx@4.20.4))
|
||||
uuid: 9.0.1
|
||||
|
||||
'@storybook/addon-actions@9.0.8': {}
|
||||
|
||||
'@storybook/addon-backgrounds@8.6.14(storybook@9.1.3(@testing-library/dom@10.4.0)(bufferutil@4.0.9)(msw@2.10.5(@types/node@22.17.2)(typescript@5.9.2))(prettier@3.6.2)(utf-8-validate@6.0.5)(vite@7.1.3(@types/node@22.17.2)(sass@1.90.0)(terser@5.43.1)(tsx@4.20.4)))':
|
||||
dependencies:
|
||||
'@storybook/global': 5.0.0
|
||||
|
@ -15544,7 +15536,7 @@ snapshots:
|
|||
'@typescript-eslint/types': 8.40.0
|
||||
'@typescript-eslint/typescript-estree': 8.40.0(typescript@5.9.2)
|
||||
'@typescript-eslint/visitor-keys': 8.40.0
|
||||
debug: 4.4.1(supports-color@10.2.0)
|
||||
debug: 4.4.1(supports-color@5.5.0)
|
||||
eslint: 9.34.0
|
||||
typescript: 5.9.2
|
||||
transitivePeerDependencies:
|
||||
|
@ -15563,7 +15555,7 @@ snapshots:
|
|||
dependencies:
|
||||
'@typescript-eslint/tsconfig-utils': 8.40.0(typescript@5.9.2)
|
||||
'@typescript-eslint/types': 8.40.0
|
||||
debug: 4.4.1(supports-color@10.2.0)
|
||||
debug: 4.4.1(supports-color@5.5.0)
|
||||
typescript: 5.9.2
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
@ -15603,7 +15595,7 @@ snapshots:
|
|||
'@typescript-eslint/types': 8.40.0
|
||||
'@typescript-eslint/typescript-estree': 8.40.0(typescript@5.9.2)
|
||||
'@typescript-eslint/utils': 8.40.0(eslint@9.34.0)(typescript@5.9.2)
|
||||
debug: 4.4.1(supports-color@10.2.0)
|
||||
debug: 4.4.1(supports-color@5.5.0)
|
||||
eslint: 9.34.0
|
||||
ts-api-utils: 2.1.0(typescript@5.9.2)
|
||||
typescript: 5.9.2
|
||||
|
@ -15636,7 +15628,7 @@ snapshots:
|
|||
'@typescript-eslint/tsconfig-utils': 8.40.0(typescript@5.9.2)
|
||||
'@typescript-eslint/types': 8.40.0
|
||||
'@typescript-eslint/visitor-keys': 8.40.0
|
||||
debug: 4.4.1(supports-color@10.2.0)
|
||||
debug: 4.4.1(supports-color@5.5.0)
|
||||
fast-glob: 3.3.3
|
||||
is-glob: 4.0.3
|
||||
minimatch: 9.0.5
|
||||
|
@ -15691,7 +15683,7 @@ snapshots:
|
|||
'@ampproject/remapping': 2.3.0
|
||||
'@bcoe/v8-coverage': 1.0.2
|
||||
ast-v8-to-istanbul: 0.3.3
|
||||
debug: 4.4.1(supports-color@10.2.0)
|
||||
debug: 4.4.1(supports-color@5.5.0)
|
||||
istanbul-lib-coverage: 3.2.2
|
||||
istanbul-lib-report: 3.0.1
|
||||
istanbul-lib-source-maps: 5.0.6
|
||||
|
@ -17545,7 +17537,7 @@ snapshots:
|
|||
|
||||
esbuild-register@3.5.0(esbuild@0.25.9):
|
||||
dependencies:
|
||||
debug: 4.4.1(supports-color@10.2.0)
|
||||
debug: 4.4.1(supports-color@5.5.0)
|
||||
esbuild: 0.25.9
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
@ -17724,7 +17716,7 @@ snapshots:
|
|||
ajv: 6.12.6
|
||||
chalk: 4.1.2
|
||||
cross-spawn: 7.0.6
|
||||
debug: 4.4.1(supports-color@10.2.0)
|
||||
debug: 4.4.1(supports-color@5.5.0)
|
||||
escape-string-regexp: 4.0.0
|
||||
eslint-scope: 8.4.0
|
||||
eslint-visitor-keys: 4.2.1
|
||||
|
@ -18147,7 +18139,7 @@ snapshots:
|
|||
|
||||
follow-redirects@1.15.9(debug@4.4.1):
|
||||
optionalDependencies:
|
||||
debug: 4.4.1(supports-color@10.2.0)
|
||||
debug: 4.4.1(supports-color@5.5.0)
|
||||
|
||||
for-each@0.3.5:
|
||||
dependencies:
|
||||
|
@ -18553,7 +18545,7 @@ snapshots:
|
|||
http-proxy-agent@7.0.2:
|
||||
dependencies:
|
||||
agent-base: 7.1.3
|
||||
debug: 4.4.1(supports-color@10.2.0)
|
||||
debug: 4.4.1(supports-color@5.5.0)
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
|
@ -18586,6 +18578,13 @@ snapshots:
|
|||
- supports-color
|
||||
optional: true
|
||||
|
||||
https-proxy-agent@7.0.6:
|
||||
dependencies:
|
||||
agent-base: 7.1.3
|
||||
debug: 4.4.1(supports-color@5.5.0)
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
||||
https-proxy-agent@7.0.6(supports-color@10.2.0):
|
||||
dependencies:
|
||||
agent-base: 7.1.3
|
||||
|
@ -18928,7 +18927,7 @@ snapshots:
|
|||
istanbul-lib-source-maps@5.0.6:
|
||||
dependencies:
|
||||
'@jridgewell/trace-mapping': 0.3.29
|
||||
debug: 4.4.1(supports-color@10.2.0)
|
||||
debug: 4.4.1(supports-color@5.5.0)
|
||||
istanbul-lib-coverage: 3.2.2
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
|
@ -19307,7 +19306,7 @@ snapshots:
|
|||
decimal.js: 10.5.0
|
||||
html-encoding-sniffer: 4.0.0
|
||||
http-proxy-agent: 7.0.2
|
||||
https-proxy-agent: 7.0.6(supports-color@10.2.0)
|
||||
https-proxy-agent: 7.0.6
|
||||
is-potential-custom-element-name: 1.0.1
|
||||
nwsapi: 2.2.16
|
||||
parse5: 7.3.0
|
||||
|
@ -19938,7 +19937,7 @@ snapshots:
|
|||
micromark@4.0.0:
|
||||
dependencies:
|
||||
'@types/debug': 4.1.12
|
||||
debug: 4.4.1(supports-color@10.2.0)
|
||||
debug: 4.4.1(supports-color@5.5.0)
|
||||
decode-named-character-reference: 1.0.2
|
||||
devlop: 1.1.0
|
||||
micromark-core-commonmark: 2.0.0
|
||||
|
@ -21921,7 +21920,7 @@ snapshots:
|
|||
arg: 5.0.2
|
||||
bluebird: 3.7.2
|
||||
check-more-types: 2.24.0
|
||||
debug: 4.4.1(supports-color@10.2.0)
|
||||
debug: 4.4.1(supports-color@5.5.0)
|
||||
execa: 5.1.1
|
||||
lazy-ass: 1.6.0
|
||||
ps-tree: 1.2.0
|
||||
|
@ -22671,7 +22670,7 @@ snapshots:
|
|||
vite-node@3.2.4(@types/node@22.17.2)(sass@1.90.0)(terser@5.43.1)(tsx@4.20.4):
|
||||
dependencies:
|
||||
cac: 6.7.14
|
||||
debug: 4.4.1(supports-color@10.2.0)
|
||||
debug: 4.4.1(supports-color@5.5.0)
|
||||
es-module-lexer: 1.7.0
|
||||
pathe: 2.0.3
|
||||
vite: 7.1.3(@types/node@22.17.2)(sass@1.90.0)(terser@5.43.1)(tsx@4.20.4)
|
||||
|
@ -22778,7 +22777,7 @@ snapshots:
|
|||
'@vitest/spy': 3.2.4
|
||||
'@vitest/utils': 3.2.4
|
||||
chai: 5.2.0
|
||||
debug: 4.4.1(supports-color@10.2.0)
|
||||
debug: 4.4.1(supports-color@5.5.0)
|
||||
expect-type: 1.2.1
|
||||
magic-string: 0.30.18
|
||||
pathe: 2.0.3
|
||||
|
@ -22910,7 +22909,7 @@ snapshots:
|
|||
|
||||
vue-eslint-parser@10.2.0(eslint@9.34.0):
|
||||
dependencies:
|
||||
debug: 4.4.1(supports-color@10.2.0)
|
||||
debug: 4.4.1(supports-color@5.5.0)
|
||||
eslint: 9.34.0
|
||||
eslint-scope: 8.4.0
|
||||
eslint-visitor-keys: 4.2.1
|
||||
|
|
Loading…
Reference in New Issue