Merge branch 'develop' into feat/frontend/copy-note-link-on-remote
This commit is contained in:
commit
4ab74d83f2
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
### Note
|
### Note
|
||||||
- コントロールパネル内にあるサマリープロキシの設定個所がセキュリティから全般へ変更となります。
|
- コントロールパネル内にあるサマリープロキシの設定個所がセキュリティから全般へ変更となります。
|
||||||
|
- 悪意のある第三者がリモートユーザーになりすましたアクティビティを受け取れてしまう問題を修正しました。詳しくは[GitHub security advisory](https://github.com/misskey-dev/misskey/security/advisories/GHSA-2vxv-pv3m-3wvj)をご覧ください。
|
||||||
|
|
||||||
### General
|
### General
|
||||||
- Enhance: URLプレビューの有効化・無効化を設定できるように #13569
|
- Enhance: URLプレビューの有効化・無効化を設定できるように #13569
|
||||||
|
@ -56,10 +57,12 @@
|
||||||
- Fix: ページのOGP URLが間違っているのを修正
|
- Fix: ページのOGP URLが間違っているのを修正
|
||||||
- Fix: リバーシの対局を正しく共有できないことがある問題を修正
|
- Fix: リバーシの対局を正しく共有できないことがある問題を修正
|
||||||
- Fix: 通知をグループ化している際に、人数が正常に表示されないことがある問題を修正
|
- Fix: 通知をグループ化している際に、人数が正常に表示されないことがある問題を修正
|
||||||
|
- Fix: 連合なしの状態の読み書きができない問題を修正
|
||||||
|
|
||||||
### Server
|
### Server
|
||||||
- Enhance: エンドポイント`antennas/update`の必須項目を`antennaId`のみに
|
- Enhance: エンドポイント`antennas/update`の必須項目を`antennaId`のみに
|
||||||
- Enhance: misskey-dev/summaly@5.1.0の取り込み(プレビュー生成処理の効率化)
|
- Enhance: misskey-dev/summaly@5.1.0の取り込み(プレビュー生成処理の効率化)
|
||||||
|
- Fix: リモートから配送されたアクティビティにJSON-LD compactionをかける
|
||||||
- Fix: フォローリクエストを作成する際に既存のものは削除するように
|
- Fix: フォローリクエストを作成する際に既存のものは削除するように
|
||||||
(Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/440)
|
(Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/440)
|
||||||
- Fix: エンドポイント`notes/translate`のエラーを改善
|
- Fix: エンドポイント`notes/translate`のエラーを改善
|
||||||
|
@ -74,6 +77,8 @@
|
||||||
- Fix: グローバルタイムラインで返信が表示されないことがある問題を修正
|
- Fix: グローバルタイムラインで返信が表示されないことがある問題を修正
|
||||||
- Fix: リノートをミュートしたユーザの投稿のリノートがミュートされる問題を修正
|
- Fix: リノートをミュートしたユーザの投稿のリノートがミュートされる問題を修正
|
||||||
- Fix: AP Link等は添付ファイル扱いしないようになど (#13754)
|
- Fix: AP Link等は添付ファイル扱いしないようになど (#13754)
|
||||||
|
- Enhance: ドライブのファイルがNSFWかどうか個別に連合されるように (#13756)
|
||||||
|
- 可能な場合、ノートの添付ファイルのセンシティブ判定がファイル単位になります
|
||||||
|
|
||||||
## 2024.3.1
|
## 2024.3.1
|
||||||
|
|
||||||
|
|
|
@ -4952,6 +4952,10 @@ export interface Locale extends ILocale {
|
||||||
* フォローの際常に確認する
|
* フォローの際常に確認する
|
||||||
*/
|
*/
|
||||||
"alwaysConfirmFollow": string;
|
"alwaysConfirmFollow": string;
|
||||||
|
/**
|
||||||
|
* お問い合わせ
|
||||||
|
*/
|
||||||
|
"inquiry": string;
|
||||||
"_bubbleGame": {
|
"_bubbleGame": {
|
||||||
/**
|
/**
|
||||||
* 遊び方
|
* 遊び方
|
||||||
|
|
|
@ -1234,6 +1234,7 @@ keepOriginalFilename: "オリジナルのファイル名を保持"
|
||||||
keepOriginalFilenameDescription: "この設定をオフにすると、アップロード時にファイル名が自動でランダム文字列に置き換えられます。"
|
keepOriginalFilenameDescription: "この設定をオフにすると、アップロード時にファイル名が自動でランダム文字列に置き換えられます。"
|
||||||
noDescription: "説明文はありません"
|
noDescription: "説明文はありません"
|
||||||
alwaysConfirmFollow: "フォローの際常に確認する"
|
alwaysConfirmFollow: "フォローの際常に確認する"
|
||||||
|
inquiry: "お問い合わせ"
|
||||||
|
|
||||||
_bubbleGame:
|
_bubbleGame:
|
||||||
howToPlay: "遊び方"
|
howToPlay: "遊び方"
|
||||||
|
|
|
@ -127,7 +127,7 @@ import { ApMfmService } from './activitypub/ApMfmService.js';
|
||||||
import { ApRendererService } from './activitypub/ApRendererService.js';
|
import { ApRendererService } from './activitypub/ApRendererService.js';
|
||||||
import { ApRequestService } from './activitypub/ApRequestService.js';
|
import { ApRequestService } from './activitypub/ApRequestService.js';
|
||||||
import { ApResolverService } from './activitypub/ApResolverService.js';
|
import { ApResolverService } from './activitypub/ApResolverService.js';
|
||||||
import { LdSignatureService } from './activitypub/LdSignatureService.js';
|
import { JsonLdService } from './activitypub/JsonLdService.js';
|
||||||
import { RemoteLoggerService } from './RemoteLoggerService.js';
|
import { RemoteLoggerService } from './RemoteLoggerService.js';
|
||||||
import { RemoteUserResolveService } from './RemoteUserResolveService.js';
|
import { RemoteUserResolveService } from './RemoteUserResolveService.js';
|
||||||
import { WebfingerService } from './WebfingerService.js';
|
import { WebfingerService } from './WebfingerService.js';
|
||||||
|
@ -266,7 +266,7 @@ const $ApMfmService: Provider = { provide: 'ApMfmService', useExisting: ApMfmSer
|
||||||
const $ApRendererService: Provider = { provide: 'ApRendererService', useExisting: ApRendererService };
|
const $ApRendererService: Provider = { provide: 'ApRendererService', useExisting: ApRendererService };
|
||||||
const $ApRequestService: Provider = { provide: 'ApRequestService', useExisting: ApRequestService };
|
const $ApRequestService: Provider = { provide: 'ApRequestService', useExisting: ApRequestService };
|
||||||
const $ApResolverService: Provider = { provide: 'ApResolverService', useExisting: ApResolverService };
|
const $ApResolverService: Provider = { provide: 'ApResolverService', useExisting: ApResolverService };
|
||||||
const $LdSignatureService: Provider = { provide: 'LdSignatureService', useExisting: LdSignatureService };
|
const $JsonLdService: Provider = { provide: 'JsonLdService', useExisting: JsonLdService };
|
||||||
const $RemoteLoggerService: Provider = { provide: 'RemoteLoggerService', useExisting: RemoteLoggerService };
|
const $RemoteLoggerService: Provider = { provide: 'RemoteLoggerService', useExisting: RemoteLoggerService };
|
||||||
const $RemoteUserResolveService: Provider = { provide: 'RemoteUserResolveService', useExisting: RemoteUserResolveService };
|
const $RemoteUserResolveService: Provider = { provide: 'RemoteUserResolveService', useExisting: RemoteUserResolveService };
|
||||||
const $WebfingerService: Provider = { provide: 'WebfingerService', useExisting: WebfingerService };
|
const $WebfingerService: Provider = { provide: 'WebfingerService', useExisting: WebfingerService };
|
||||||
|
@ -406,7 +406,7 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting
|
||||||
ApRendererService,
|
ApRendererService,
|
||||||
ApRequestService,
|
ApRequestService,
|
||||||
ApResolverService,
|
ApResolverService,
|
||||||
LdSignatureService,
|
JsonLdService,
|
||||||
RemoteLoggerService,
|
RemoteLoggerService,
|
||||||
RemoteUserResolveService,
|
RemoteUserResolveService,
|
||||||
WebfingerService,
|
WebfingerService,
|
||||||
|
@ -542,7 +542,7 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting
|
||||||
$ApRendererService,
|
$ApRendererService,
|
||||||
$ApRequestService,
|
$ApRequestService,
|
||||||
$ApResolverService,
|
$ApResolverService,
|
||||||
$LdSignatureService,
|
$JsonLdService,
|
||||||
$RemoteLoggerService,
|
$RemoteLoggerService,
|
||||||
$RemoteUserResolveService,
|
$RemoteUserResolveService,
|
||||||
$WebfingerService,
|
$WebfingerService,
|
||||||
|
@ -678,7 +678,7 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting
|
||||||
ApRendererService,
|
ApRendererService,
|
||||||
ApRequestService,
|
ApRequestService,
|
||||||
ApResolverService,
|
ApResolverService,
|
||||||
LdSignatureService,
|
JsonLdService,
|
||||||
RemoteLoggerService,
|
RemoteLoggerService,
|
||||||
RemoteUserResolveService,
|
RemoteUserResolveService,
|
||||||
WebfingerService,
|
WebfingerService,
|
||||||
|
@ -813,7 +813,7 @@ const $ApQuestionService: Provider = { provide: 'ApQuestionService', useExisting
|
||||||
$ApRendererService,
|
$ApRendererService,
|
||||||
$ApRequestService,
|
$ApRequestService,
|
||||||
$ApResolverService,
|
$ApResolverService,
|
||||||
$LdSignatureService,
|
$JsonLdService,
|
||||||
$RemoteLoggerService,
|
$RemoteLoggerService,
|
||||||
$RemoteUserResolveService,
|
$RemoteUserResolveService,
|
||||||
$WebfingerService,
|
$WebfingerService,
|
||||||
|
|
|
@ -28,8 +28,9 @@ import { bindThis } from '@/decorators.js';
|
||||||
import { CustomEmojiService } from '@/core/CustomEmojiService.js';
|
import { CustomEmojiService } from '@/core/CustomEmojiService.js';
|
||||||
import { isNotNull } from '@/misc/is-not-null.js';
|
import { isNotNull } from '@/misc/is-not-null.js';
|
||||||
import { IdService } from '@/core/IdService.js';
|
import { IdService } from '@/core/IdService.js';
|
||||||
import { LdSignatureService } from './LdSignatureService.js';
|
import { JsonLdService } from './JsonLdService.js';
|
||||||
import { ApMfmService } from './ApMfmService.js';
|
import { ApMfmService } from './ApMfmService.js';
|
||||||
|
import { CONTEXT } from './misc/contexts.js';
|
||||||
import type { IAccept, IActivity, IAdd, IAnnounce, IApDocument, IApEmoji, IApHashtag, IApImage, IApMention, IBlock, ICreate, IDelete, IFlag, IFollow, IKey, ILike, IMove, IObject, IPost, IQuestion, IReject, IRemove, ITombstone, IUndo, IUpdate } from './type.js';
|
import type { IAccept, IActivity, IAdd, IAnnounce, IApDocument, IApEmoji, IApHashtag, IApImage, IApMention, IBlock, ICreate, IDelete, IFlag, IFollow, IKey, ILike, IMove, IObject, IPost, IQuestion, IReject, IRemove, ITombstone, IUndo, IUpdate } from './type.js';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
|
@ -56,7 +57,7 @@ export class ApRendererService {
|
||||||
private customEmojiService: CustomEmojiService,
|
private customEmojiService: CustomEmojiService,
|
||||||
private userEntityService: UserEntityService,
|
private userEntityService: UserEntityService,
|
||||||
private driveFileEntityService: DriveFileEntityService,
|
private driveFileEntityService: DriveFileEntityService,
|
||||||
private ldSignatureService: LdSignatureService,
|
private jsonLdService: JsonLdService,
|
||||||
private userKeypairService: UserKeypairService,
|
private userKeypairService: UserKeypairService,
|
||||||
private apMfmService: ApMfmService,
|
private apMfmService: ApMfmService,
|
||||||
private mfmService: MfmService,
|
private mfmService: MfmService,
|
||||||
|
@ -166,6 +167,7 @@ export class ApRendererService {
|
||||||
mediaType: file.webpublicType ?? file.type,
|
mediaType: file.webpublicType ?? file.type,
|
||||||
url: this.driveFileEntityService.getPublicUrl(file),
|
url: this.driveFileEntityService.getPublicUrl(file),
|
||||||
name: file.comment,
|
name: file.comment,
|
||||||
|
sensitive: file.isSensitive,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -617,48 +619,16 @@ export class ApRendererService {
|
||||||
x.id = `${this.config.url}/${randomUUID()}`;
|
x.id = `${this.config.url}/${randomUUID()}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Object.assign({
|
return Object.assign({ '@context': CONTEXT }, x as T & { id: string });
|
||||||
'@context': [
|
|
||||||
'https://www.w3.org/ns/activitystreams',
|
|
||||||
'https://w3id.org/security/v1',
|
|
||||||
{
|
|
||||||
Key: 'sec:Key',
|
|
||||||
// as non-standards
|
|
||||||
manuallyApprovesFollowers: 'as:manuallyApprovesFollowers',
|
|
||||||
sensitive: 'as:sensitive',
|
|
||||||
Hashtag: 'as:Hashtag',
|
|
||||||
quoteUrl: 'as:quoteUrl',
|
|
||||||
// Mastodon
|
|
||||||
toot: 'http://joinmastodon.org/ns#',
|
|
||||||
Emoji: 'toot:Emoji',
|
|
||||||
featured: 'toot:featured',
|
|
||||||
discoverable: 'toot:discoverable',
|
|
||||||
// schema
|
|
||||||
schema: 'http://schema.org#',
|
|
||||||
PropertyValue: 'schema:PropertyValue',
|
|
||||||
value: 'schema:value',
|
|
||||||
// Misskey
|
|
||||||
misskey: 'https://misskey-hub.net/ns#',
|
|
||||||
'_misskey_content': 'misskey:_misskey_content',
|
|
||||||
'_misskey_quote': 'misskey:_misskey_quote',
|
|
||||||
'_misskey_reaction': 'misskey:_misskey_reaction',
|
|
||||||
'_misskey_votes': 'misskey:_misskey_votes',
|
|
||||||
'_misskey_summary': 'misskey:_misskey_summary',
|
|
||||||
'isCat': 'misskey:isCat',
|
|
||||||
// vcard
|
|
||||||
vcard: 'http://www.w3.org/2006/vcard/ns#',
|
|
||||||
},
|
|
||||||
],
|
|
||||||
}, x as T & { id: string });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
public async attachLdSignature(activity: any, user: { id: MiUser['id']; host: null; }): Promise<IActivity> {
|
public async attachLdSignature(activity: any, user: { id: MiUser['id']; host: null; }): Promise<IActivity> {
|
||||||
const keypair = await this.userKeypairService.getUserKeypair(user.id);
|
const keypair = await this.userKeypairService.getUserKeypair(user.id);
|
||||||
|
|
||||||
const ldSignature = this.ldSignatureService.use();
|
const jsonLd = this.jsonLdService.use();
|
||||||
ldSignature.debug = false;
|
jsonLd.debug = false;
|
||||||
activity = await ldSignature.signRsaSignature2017(activity, keypair.privateKey, `${this.config.url}/users/${user.id}#main-key`);
|
activity = await jsonLd.signRsaSignature2017(activity, keypair.privateKey, `${this.config.url}/users/${user.id}#main-key`);
|
||||||
|
|
||||||
return activity;
|
return activity;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,14 +7,14 @@ import * as crypto from 'node:crypto';
|
||||||
import { Injectable } from '@nestjs/common';
|
import { Injectable } from '@nestjs/common';
|
||||||
import { HttpRequestService } from '@/core/HttpRequestService.js';
|
import { HttpRequestService } from '@/core/HttpRequestService.js';
|
||||||
import { bindThis } from '@/decorators.js';
|
import { bindThis } from '@/decorators.js';
|
||||||
import { CONTEXTS } from './misc/contexts.js';
|
import { CONTEXT, PRELOADED_CONTEXTS } from './misc/contexts.js';
|
||||||
import { validateContentTypeSetAsJsonLD } from './misc/validator.js';
|
import { validateContentTypeSetAsJsonLD } from './misc/validator.js';
|
||||||
import type { JsonLdDocument } from 'jsonld';
|
import type { JsonLdDocument } from 'jsonld';
|
||||||
import type { JsonLd, RemoteDocument } from 'jsonld/jsonld-spec.js';
|
import type { JsonLd as JsonLdObject, RemoteDocument } from 'jsonld/jsonld-spec.js';
|
||||||
|
|
||||||
// RsaSignature2017 based from https://github.com/transmute-industries/RsaSignature2017
|
// RsaSignature2017 implementation is based on https://github.com/transmute-industries/RsaSignature2017
|
||||||
|
|
||||||
class LdSignature {
|
class JsonLd {
|
||||||
public debug = false;
|
public debug = false;
|
||||||
public preLoad = true;
|
public preLoad = true;
|
||||||
public loderTimeout = 5000;
|
public loderTimeout = 5000;
|
||||||
|
@ -89,10 +89,18 @@ class LdSignature {
|
||||||
}
|
}
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
public async normalize(data: JsonLdDocument): Promise<string> {
|
public async compact(data: any, context: any = CONTEXT): Promise<JsonLdDocument> {
|
||||||
const customLoader = this.getLoader();
|
const customLoader = this.getLoader();
|
||||||
// XXX: Importing jsonld dynamically since Jest frequently fails to import it statically
|
// XXX: Importing jsonld dynamically since Jest frequently fails to import it statically
|
||||||
// https://github.com/misskey-dev/misskey/pull/9894#discussion_r1103753595
|
// https://github.com/misskey-dev/misskey/pull/9894#discussion_r1103753595
|
||||||
|
return (await import('jsonld')).default.compact(data, context, {
|
||||||
|
documentLoader: customLoader,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@bindThis
|
||||||
|
public async normalize(data: JsonLdDocument): Promise<string> {
|
||||||
|
const customLoader = this.getLoader();
|
||||||
return (await import('jsonld')).default.normalize(data, {
|
return (await import('jsonld')).default.normalize(data, {
|
||||||
documentLoader: customLoader,
|
documentLoader: customLoader,
|
||||||
});
|
});
|
||||||
|
@ -104,11 +112,11 @@ class LdSignature {
|
||||||
if (!/^https?:\/\//.test(url)) throw new Error(`Invalid URL ${url}`);
|
if (!/^https?:\/\//.test(url)) throw new Error(`Invalid URL ${url}`);
|
||||||
|
|
||||||
if (this.preLoad) {
|
if (this.preLoad) {
|
||||||
if (url in CONTEXTS) {
|
if (url in PRELOADED_CONTEXTS) {
|
||||||
if (this.debug) console.debug(`HIT: ${url}`);
|
if (this.debug) console.debug(`HIT: ${url}`);
|
||||||
return {
|
return {
|
||||||
contextUrl: undefined,
|
contextUrl: undefined,
|
||||||
document: CONTEXTS[url],
|
document: PRELOADED_CONTEXTS[url],
|
||||||
documentUrl: url,
|
documentUrl: url,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -125,7 +133,7 @@ class LdSignature {
|
||||||
}
|
}
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
private async fetchDocument(url: string): Promise<JsonLd> {
|
private async fetchDocument(url: string): Promise<JsonLdObject> {
|
||||||
const json = await this.httpRequestService.send(
|
const json = await this.httpRequestService.send(
|
||||||
url,
|
url,
|
||||||
{
|
{
|
||||||
|
@ -146,7 +154,7 @@ class LdSignature {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
return json as JsonLd;
|
return json as JsonLdObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
|
@ -158,14 +166,14 @@ class LdSignature {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class LdSignatureService {
|
export class JsonLdService {
|
||||||
constructor(
|
constructor(
|
||||||
private httpRequestService: HttpRequestService,
|
private httpRequestService: HttpRequestService,
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@bindThis
|
@bindThis
|
||||||
public use(): LdSignature {
|
public use(): JsonLd {
|
||||||
return new LdSignature(this.httpRequestService);
|
return new JsonLd(this.httpRequestService);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -3,7 +3,7 @@
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type { JsonLd } from 'jsonld/jsonld-spec.js';
|
import type { Context, JsonLd } from 'jsonld/jsonld-spec.js';
|
||||||
|
|
||||||
/* eslint:disable:quotemark indent */
|
/* eslint:disable:quotemark indent */
|
||||||
const id_v1 = {
|
const id_v1 = {
|
||||||
|
@ -526,7 +526,42 @@ const activitystreams = {
|
||||||
},
|
},
|
||||||
} satisfies JsonLd;
|
} satisfies JsonLd;
|
||||||
|
|
||||||
export const CONTEXTS: Record<string, JsonLd> = {
|
const context_iris = [
|
||||||
|
'https://www.w3.org/ns/activitystreams',
|
||||||
|
'https://w3id.org/security/v1',
|
||||||
|
];
|
||||||
|
|
||||||
|
const extension_context_definition = {
|
||||||
|
Key: 'sec:Key',
|
||||||
|
// as non-standards
|
||||||
|
manuallyApprovesFollowers: 'as:manuallyApprovesFollowers',
|
||||||
|
sensitive: 'as:sensitive',
|
||||||
|
Hashtag: 'as:Hashtag',
|
||||||
|
quoteUrl: 'as:quoteUrl',
|
||||||
|
// Mastodon
|
||||||
|
toot: 'http://joinmastodon.org/ns#',
|
||||||
|
Emoji: 'toot:Emoji',
|
||||||
|
featured: 'toot:featured',
|
||||||
|
discoverable: 'toot:discoverable',
|
||||||
|
// schema
|
||||||
|
schema: 'http://schema.org#',
|
||||||
|
PropertyValue: 'schema:PropertyValue',
|
||||||
|
value: 'schema:value',
|
||||||
|
// Misskey
|
||||||
|
misskey: 'https://misskey-hub.net/ns#',
|
||||||
|
'_misskey_content': 'misskey:_misskey_content',
|
||||||
|
'_misskey_quote': 'misskey:_misskey_quote',
|
||||||
|
'_misskey_reaction': 'misskey:_misskey_reaction',
|
||||||
|
'_misskey_votes': 'misskey:_misskey_votes',
|
||||||
|
'_misskey_summary': 'misskey:_misskey_summary',
|
||||||
|
'isCat': 'misskey:isCat',
|
||||||
|
// vcard
|
||||||
|
vcard: 'http://www.w3.org/2006/vcard/ns#',
|
||||||
|
} satisfies Context;
|
||||||
|
|
||||||
|
export const CONTEXT: (string | Context)[] = [...context_iris, extension_context_definition];
|
||||||
|
|
||||||
|
export const PRELOADED_CONTEXTS: Record<string, JsonLd> = {
|
||||||
'https://w3id.org/identity/v1': id_v1,
|
'https://w3id.org/identity/v1': id_v1,
|
||||||
'https://w3id.org/security/v1': security_v1,
|
'https://w3id.org/security/v1': security_v1,
|
||||||
'https://www.w3.org/ns/activitystreams': activitystreams,
|
'https://www.w3.org/ns/activitystreams': activitystreams,
|
||||||
|
|
|
@ -211,7 +211,7 @@ export class ApNoteService {
|
||||||
const files: MiDriveFile[] = [];
|
const files: MiDriveFile[] = [];
|
||||||
|
|
||||||
for (const attach of toArray(note.attachment)) {
|
for (const attach of toArray(note.attachment)) {
|
||||||
attach.sensitive ||= note.sensitive; // Noteがsensitiveなら添付もsensitiveにする
|
attach.sensitive ??= note.sensitive;
|
||||||
const file = await this.apImageService.resolveImage(actor, attach);
|
const file = await this.apImageService.resolveImage(actor, attach);
|
||||||
if (file) files.push(file);
|
if (file) files.push(file);
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,13 +15,14 @@ import InstanceChart from '@/core/chart/charts/instance.js';
|
||||||
import ApRequestChart from '@/core/chart/charts/ap-request.js';
|
import ApRequestChart from '@/core/chart/charts/ap-request.js';
|
||||||
import FederationChart from '@/core/chart/charts/federation.js';
|
import FederationChart from '@/core/chart/charts/federation.js';
|
||||||
import { getApId } from '@/core/activitypub/type.js';
|
import { getApId } from '@/core/activitypub/type.js';
|
||||||
|
import type { IActivity } from '@/core/activitypub/type.js';
|
||||||
import type { MiRemoteUser } from '@/models/User.js';
|
import type { MiRemoteUser } from '@/models/User.js';
|
||||||
import type { MiUserPublickey } from '@/models/UserPublickey.js';
|
import type { MiUserPublickey } from '@/models/UserPublickey.js';
|
||||||
import { ApDbResolverService } from '@/core/activitypub/ApDbResolverService.js';
|
import { ApDbResolverService } from '@/core/activitypub/ApDbResolverService.js';
|
||||||
import { StatusError } from '@/misc/status-error.js';
|
import { StatusError } from '@/misc/status-error.js';
|
||||||
import { UtilityService } from '@/core/UtilityService.js';
|
import { UtilityService } from '@/core/UtilityService.js';
|
||||||
import { ApPersonService } from '@/core/activitypub/models/ApPersonService.js';
|
import { ApPersonService } from '@/core/activitypub/models/ApPersonService.js';
|
||||||
import { LdSignatureService } from '@/core/activitypub/LdSignatureService.js';
|
import { JsonLdService } from '@/core/activitypub/JsonLdService.js';
|
||||||
import { ApInboxService } from '@/core/activitypub/ApInboxService.js';
|
import { ApInboxService } from '@/core/activitypub/ApInboxService.js';
|
||||||
import { bindThis } from '@/decorators.js';
|
import { bindThis } from '@/decorators.js';
|
||||||
import { IdentifiableError } from '@/misc/identifiable-error.js';
|
import { IdentifiableError } from '@/misc/identifiable-error.js';
|
||||||
|
@ -38,7 +39,7 @@ export class InboxProcessorService {
|
||||||
private apInboxService: ApInboxService,
|
private apInboxService: ApInboxService,
|
||||||
private federatedInstanceService: FederatedInstanceService,
|
private federatedInstanceService: FederatedInstanceService,
|
||||||
private fetchInstanceMetadataService: FetchInstanceMetadataService,
|
private fetchInstanceMetadataService: FetchInstanceMetadataService,
|
||||||
private ldSignatureService: LdSignatureService,
|
private jsonLdService: JsonLdService,
|
||||||
private apPersonService: ApPersonService,
|
private apPersonService: ApPersonService,
|
||||||
private apDbResolverService: ApDbResolverService,
|
private apDbResolverService: ApDbResolverService,
|
||||||
private instanceChart: InstanceChart,
|
private instanceChart: InstanceChart,
|
||||||
|
@ -52,7 +53,7 @@ export class InboxProcessorService {
|
||||||
@bindThis
|
@bindThis
|
||||||
public async process(job: Bull.Job<InboxJobData>): Promise<string> {
|
public async process(job: Bull.Job<InboxJobData>): Promise<string> {
|
||||||
const signature = job.data.signature; // HTTP-signature
|
const signature = job.data.signature; // HTTP-signature
|
||||||
const activity = job.data.activity;
|
let activity = job.data.activity;
|
||||||
|
|
||||||
//#region Log
|
//#region Log
|
||||||
const info = Object.assign({}, activity);
|
const info = Object.assign({}, activity);
|
||||||
|
@ -110,20 +111,21 @@ export class InboxProcessorService {
|
||||||
// また、signatureのsignerは、activity.actorと一致する必要がある
|
// また、signatureのsignerは、activity.actorと一致する必要がある
|
||||||
if (!httpSignatureValidated || authUser.user.uri !== activity.actor) {
|
if (!httpSignatureValidated || authUser.user.uri !== activity.actor) {
|
||||||
// 一致しなくても、でもLD-Signatureがありそうならそっちも見る
|
// 一致しなくても、でもLD-Signatureがありそうならそっちも見る
|
||||||
if (activity.signature) {
|
const ldSignature = activity.signature;
|
||||||
if (activity.signature.type !== 'RsaSignature2017') {
|
if (ldSignature) {
|
||||||
throw new Bull.UnrecoverableError(`skip: unsupported LD-signature type ${activity.signature.type}`);
|
if (ldSignature.type !== 'RsaSignature2017') {
|
||||||
|
throw new Bull.UnrecoverableError(`skip: unsupported LD-signature type ${ldSignature.type}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// activity.signature.creator: https://example.oom/users/user#main-key
|
// ldSignature.creator: https://example.oom/users/user#main-key
|
||||||
// みたいになっててUserを引っ張れば公開キーも入ることを期待する
|
// みたいになっててUserを引っ張れば公開キーも入ることを期待する
|
||||||
if (activity.signature.creator) {
|
if (ldSignature.creator) {
|
||||||
const candicate = activity.signature.creator.replace(/#.*/, '');
|
const candicate = ldSignature.creator.replace(/#.*/, '');
|
||||||
await this.apPersonService.resolvePerson(candicate).catch(() => null);
|
await this.apPersonService.resolvePerson(candicate).catch(() => null);
|
||||||
}
|
}
|
||||||
|
|
||||||
// keyIdからLD-Signatureのユーザーを取得
|
// keyIdからLD-Signatureのユーザーを取得
|
||||||
authUser = await this.apDbResolverService.getAuthUserFromKeyId(activity.signature.creator);
|
authUser = await this.apDbResolverService.getAuthUserFromKeyId(ldSignature.creator);
|
||||||
if (authUser == null) {
|
if (authUser == null) {
|
||||||
throw new Bull.UnrecoverableError('skip: LD-Signatureのユーザーが取得できませんでした');
|
throw new Bull.UnrecoverableError('skip: LD-Signatureのユーザーが取得できませんでした');
|
||||||
}
|
}
|
||||||
|
@ -132,13 +134,31 @@ export class InboxProcessorService {
|
||||||
throw new Bull.UnrecoverableError('skip: LD-SignatureのユーザーはpublicKeyを持っていませんでした');
|
throw new Bull.UnrecoverableError('skip: LD-SignatureのユーザーはpublicKeyを持っていませんでした');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const jsonLd = this.jsonLdService.use();
|
||||||
|
|
||||||
// LD-Signature検証
|
// LD-Signature検証
|
||||||
const ldSignature = this.ldSignatureService.use();
|
const verified = await jsonLd.verifyRsaSignature2017(activity, authUser.key.keyPem).catch(() => false);
|
||||||
const verified = await ldSignature.verifyRsaSignature2017(activity, authUser.key.keyPem).catch(() => false);
|
|
||||||
if (!verified) {
|
if (!verified) {
|
||||||
throw new Bull.UnrecoverableError('skip: LD-Signatureの検証に失敗しました');
|
throw new Bull.UnrecoverableError('skip: LD-Signatureの検証に失敗しました');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// アクティビティを正規化
|
||||||
|
delete activity.signature;
|
||||||
|
try {
|
||||||
|
activity = await jsonLd.compact(activity) as IActivity;
|
||||||
|
} catch (e) {
|
||||||
|
throw new Bull.UnrecoverableError(`skip: failed to compact activity: ${e}`);
|
||||||
|
}
|
||||||
|
// TODO: 元のアクティビティと非互換な形に正規化される場合は転送をスキップする
|
||||||
|
// https://github.com/mastodon/mastodon/blob/664b0ca/app/services/activitypub/process_collection_service.rb#L24-L29
|
||||||
|
activity.signature = ldSignature;
|
||||||
|
|
||||||
|
//#region Log
|
||||||
|
const compactedInfo = Object.assign({}, activity);
|
||||||
|
delete compactedInfo['@context'];
|
||||||
|
this.logger.debug(`compacted: ${JSON.stringify(compactedInfo, null, 2)}`);
|
||||||
|
//#endregion
|
||||||
|
|
||||||
// もう一度actorチェック
|
// もう一度actorチェック
|
||||||
if (authUser.user.uri !== activity.actor) {
|
if (authUser.user.uri !== activity.actor) {
|
||||||
throw new Bull.UnrecoverableError(`skip: LD-Signature user(${authUser.user.uri}) !== activity.actor(${activity.actor})`);
|
throw new Bull.UnrecoverableError(`skip: LD-Signature user(${authUser.user.uri}) !== activity.actor(${activity.actor})`);
|
||||||
|
|
|
@ -13,6 +13,8 @@ import { ApImageService } from '@/core/activitypub/models/ApImageService.js';
|
||||||
import { ApNoteService } from '@/core/activitypub/models/ApNoteService.js';
|
import { ApNoteService } from '@/core/activitypub/models/ApNoteService.js';
|
||||||
import { ApPersonService } from '@/core/activitypub/models/ApPersonService.js';
|
import { ApPersonService } from '@/core/activitypub/models/ApPersonService.js';
|
||||||
import { ApRendererService } from '@/core/activitypub/ApRendererService.js';
|
import { ApRendererService } from '@/core/activitypub/ApRendererService.js';
|
||||||
|
import { JsonLdService } from '@/core/activitypub/JsonLdService.js';
|
||||||
|
import { CONTEXT } from '@/core/activitypub/misc/contexts.js';
|
||||||
import { GlobalModule } from '@/GlobalModule.js';
|
import { GlobalModule } from '@/GlobalModule.js';
|
||||||
import { CoreModule } from '@/core/CoreModule.js';
|
import { CoreModule } from '@/core/CoreModule.js';
|
||||||
import { FederatedInstanceService } from '@/core/FederatedInstanceService.js';
|
import { FederatedInstanceService } from '@/core/FederatedInstanceService.js';
|
||||||
|
@ -88,6 +90,7 @@ describe('ActivityPub', () => {
|
||||||
let noteService: ApNoteService;
|
let noteService: ApNoteService;
|
||||||
let personService: ApPersonService;
|
let personService: ApPersonService;
|
||||||
let rendererService: ApRendererService;
|
let rendererService: ApRendererService;
|
||||||
|
let jsonLdService: JsonLdService;
|
||||||
let resolver: MockResolver;
|
let resolver: MockResolver;
|
||||||
|
|
||||||
const metaInitial = {
|
const metaInitial = {
|
||||||
|
@ -128,6 +131,7 @@ describe('ActivityPub', () => {
|
||||||
personService = app.get<ApPersonService>(ApPersonService);
|
personService = app.get<ApPersonService>(ApPersonService);
|
||||||
rendererService = app.get<ApRendererService>(ApRendererService);
|
rendererService = app.get<ApRendererService>(ApRendererService);
|
||||||
imageService = app.get<ApImageService>(ApImageService);
|
imageService = app.get<ApImageService>(ApImageService);
|
||||||
|
jsonLdService = app.get<JsonLdService>(JsonLdService);
|
||||||
resolver = new MockResolver(await app.resolve<LoggerService>(LoggerService));
|
resolver = new MockResolver(await app.resolve<LoggerService>(LoggerService));
|
||||||
|
|
||||||
// Prevent ApPersonService from fetching instance, as it causes Jest import-after-test error
|
// Prevent ApPersonService from fetching instance, as it causes Jest import-after-test error
|
||||||
|
@ -381,4 +385,42 @@ describe('ActivityPub', () => {
|
||||||
assert.strictEqual(driveFile, null);
|
assert.strictEqual(driveFile, null);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('JSON-LD', () =>{
|
||||||
|
test('Compaction', async () => {
|
||||||
|
const jsonLd = jsonLdService.use();
|
||||||
|
|
||||||
|
const object = {
|
||||||
|
'@context': [
|
||||||
|
'https://www.w3.org/ns/activitystreams',
|
||||||
|
{
|
||||||
|
_misskey_quote: 'https://misskey-hub.net/ns#_misskey_quote',
|
||||||
|
unknown: 'https://example.org/ns#unknown',
|
||||||
|
undefined: null,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
id: 'https://example.com/notes/42',
|
||||||
|
type: 'Note',
|
||||||
|
attributedTo: 'https://example.com/users/1',
|
||||||
|
to: ['https://www.w3.org/ns/activitystreams#Public'],
|
||||||
|
content: 'test test foo',
|
||||||
|
_misskey_quote: 'https://example.com/notes/1',
|
||||||
|
unknown: 'test test bar',
|
||||||
|
undefined: 'test test baz',
|
||||||
|
};
|
||||||
|
const compacted = await jsonLd.compact(object);
|
||||||
|
|
||||||
|
assert.deepStrictEqual(compacted, {
|
||||||
|
'@context': CONTEXT,
|
||||||
|
id: 'https://example.com/notes/42',
|
||||||
|
type: 'Note',
|
||||||
|
attributedTo: 'https://example.com/users/1',
|
||||||
|
to: 'as:Public',
|
||||||
|
content: 'test test foo',
|
||||||
|
_misskey_quote: 'https://example.com/notes/1',
|
||||||
|
'https://example.org/ns#unknown': 'test test bar',
|
||||||
|
// undefined: 'test test baz',
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -27,7 +27,7 @@ export function galleryPost(isSensitive = false) {
|
||||||
id: 'somepostid',
|
id: 'somepostid',
|
||||||
createdAt: '2016-12-28T22:49:51.000Z',
|
createdAt: '2016-12-28T22:49:51.000Z',
|
||||||
updatedAt: '2016-12-28T22:49:51.000Z',
|
updatedAt: '2016-12-28T22:49:51.000Z',
|
||||||
userid: 'someuserid',
|
userId: 'someuserid',
|
||||||
user: userDetailed(),
|
user: userDetailed(),
|
||||||
title: 'Some post title',
|
title: 'Some post title',
|
||||||
description: 'Some post description',
|
description: 'Some post description',
|
||||||
|
@ -75,9 +75,8 @@ export function userDetailed(id = 'someuserid', username = 'miskist', host = 'mi
|
||||||
avatarUrl: 'https://github.com/misskey-dev/misskey/blob/master/packages/frontend/assets/about-icon.png?raw=true',
|
avatarUrl: 'https://github.com/misskey-dev/misskey/blob/master/packages/frontend/assets/about-icon.png?raw=true',
|
||||||
avatarBlurhash: 'eQFRshof5NWBRi},juayfPju53WB?0ofs;s*a{ofjuay^SoMEJR%ay',
|
avatarBlurhash: 'eQFRshof5NWBRi},juayfPju53WB?0ofs;s*a{ofjuay^SoMEJR%ay',
|
||||||
avatarDecorations: [],
|
avatarDecorations: [],
|
||||||
emojis: [],
|
emojis: {},
|
||||||
bannerBlurhash: 'eQA^IW^-MH8w9tE8I=S^o{$*R4RikXtSxutRozjEnNR.RQadoyozog',
|
bannerBlurhash: 'eQA^IW^-MH8w9tE8I=S^o{$*R4RikXtSxutRozjEnNR.RQadoyozog',
|
||||||
bannerColor: '#000000',
|
|
||||||
bannerUrl: 'https://github.com/misskey-dev/misskey/blob/master/packages/frontend/assets/fedi.jpg?raw=true',
|
bannerUrl: 'https://github.com/misskey-dev/misskey/blob/master/packages/frontend/assets/fedi.jpg?raw=true',
|
||||||
birthday: '2014-06-20',
|
birthday: '2014-06-20',
|
||||||
createdAt: '2016-12-28T22:49:51.000Z',
|
createdAt: '2016-12-28T22:49:51.000Z',
|
||||||
|
@ -118,11 +117,16 @@ export function userDetailed(id = 'someuserid', username = 'miskist', host = 'mi
|
||||||
publicReactions: false,
|
publicReactions: false,
|
||||||
securityKeys: false,
|
securityKeys: false,
|
||||||
twoFactorEnabled: false,
|
twoFactorEnabled: false,
|
||||||
|
usePasswordLessLogin: false,
|
||||||
twoFactorBackupCodesStock: 'none',
|
twoFactorBackupCodesStock: 'none',
|
||||||
updatedAt: null,
|
updatedAt: null,
|
||||||
|
lastFetchedAt: null,
|
||||||
uri: null,
|
uri: null,
|
||||||
url: null,
|
url: null,
|
||||||
|
movedTo: null,
|
||||||
|
alsoKnownAs: null,
|
||||||
notify: 'none',
|
notify: 'none',
|
||||||
|
memo: null
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -82,14 +82,8 @@ function h<T extends estree.Node>(
|
||||||
return Object.assign(props || {}, { type }) as T;
|
return Object.assign(props || {}, { type }) as T;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare namespace h.JSX {
|
||||||
namespace JSX {
|
|
||||||
type Element = estree.Node;
|
type Element = estree.Node;
|
||||||
type ElementClass = never;
|
|
||||||
type ElementAttributesProperty = never;
|
|
||||||
type ElementChildrenAttribute = never;
|
|
||||||
type IntrinsicAttributes = never;
|
|
||||||
type IntrinsicClassAttributes<T> = never;
|
|
||||||
type IntrinsicElements = {
|
type IntrinsicElements = {
|
||||||
[T in keyof typeof generator as ToKebab<SplitCamel<Uncapitalize<T>>>]: {
|
[T in keyof typeof generator as ToKebab<SplitCamel<Uncapitalize<T>>>]: {
|
||||||
[K in keyof Omit<
|
[K in keyof Omit<
|
||||||
|
@ -98,7 +92,6 @@ declare global {
|
||||||
>]?: Parameters<(typeof generator)[T]>[0][K];
|
>]?: Parameters<(typeof generator)[T]>[0][K];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function toStories(component: string): Promise<string> {
|
function toStories(component: string): Promise<string> {
|
||||||
|
@ -388,6 +381,7 @@ function toStories(component: string): Promise<string> {
|
||||||
'/* eslint-disable @typescript-eslint/explicit-function-return-type */\n' +
|
'/* eslint-disable @typescript-eslint/explicit-function-return-type */\n' +
|
||||||
'/* eslint-disable import/no-default-export */\n' +
|
'/* eslint-disable import/no-default-export */\n' +
|
||||||
'/* eslint-disable import/no-duplicates */\n' +
|
'/* eslint-disable import/no-duplicates */\n' +
|
||||||
|
'/* eslint-disable import/order */\n' +
|
||||||
generate(program, { generator }) +
|
generate(program, { generator }) +
|
||||||
(hasImplStories ? readFileSync(`${implStories}.ts`, 'utf-8') : ''),
|
(hasImplStories ? readFileSync(`${implStories}.ts`, 'utf-8') : ''),
|
||||||
{
|
{
|
||||||
|
|
|
@ -34,7 +34,7 @@ const config = {
|
||||||
disableTelemetry: true,
|
disableTelemetry: true,
|
||||||
},
|
},
|
||||||
async viteFinal(config) {
|
async viteFinal(config) {
|
||||||
const replacePluginForIsChromatic = config.plugins?.findIndex((plugin) => plugin && (plugin as Partial<Plugin>)?.name === 'replace') ?? -1;
|
const replacePluginForIsChromatic = config.plugins?.findIndex((plugin: Plugin) => plugin && plugin.name === 'replace') ?? -1;
|
||||||
if (~replacePluginForIsChromatic) {
|
if (~replacePluginForIsChromatic) {
|
||||||
config.plugins?.splice(replacePluginForIsChromatic, 1);
|
config.plugins?.splice(replacePluginForIsChromatic, 1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,8 @@
|
||||||
import { type SharedOptions, http, HttpResponse } from 'msw';
|
import { type SharedOptions, http, HttpResponse } from 'msw';
|
||||||
|
|
||||||
export const onUnhandledRequest = ((req, print) => {
|
export const onUnhandledRequest = ((req, print) => {
|
||||||
if (req.url.hostname !== 'localhost' || /^\/(?:client-assets\/|fluent-emojis?\/|iframe.html$|node_modules\/|src\/|sb-|static-assets\/|vite\/)/.test(req.url.pathname)) {
|
const url = new URL(req.url);
|
||||||
|
if (url.hostname !== 'localhost' || /^\/(?:client-assets\/|fluent-emojis?\/|iframe.html$|node_modules\/|src\/|sb-|static-assets\/|vite\/)/.test(url.pathname)) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
print.warning()
|
print.warning()
|
||||||
|
|
|
@ -78,24 +78,24 @@
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@misskey-dev/eslint-plugin": "1.0.0",
|
"@misskey-dev/eslint-plugin": "1.0.0",
|
||||||
"@misskey-dev/summaly": "5.0.3",
|
"@misskey-dev/summaly": "5.0.3",
|
||||||
"@storybook/addon-actions": "8.0.0-beta.6",
|
"@storybook/addon-actions": "8.0.9",
|
||||||
"@storybook/addon-essentials": "8.0.0-beta.6",
|
"@storybook/addon-essentials": "8.0.9",
|
||||||
"@storybook/addon-interactions": "8.0.0-beta.6",
|
"@storybook/addon-interactions": "8.0.9",
|
||||||
"@storybook/addon-links": "8.0.0-beta.6",
|
"@storybook/addon-links": "8.0.9",
|
||||||
"@storybook/addon-mdx-gfm": "8.0.0-beta.6",
|
"@storybook/addon-mdx-gfm": "8.0.9",
|
||||||
"@storybook/addon-storysource": "8.0.0-beta.6",
|
"@storybook/addon-storysource": "8.0.9",
|
||||||
"@storybook/blocks": "8.0.0-beta.6",
|
"@storybook/blocks": "8.0.9",
|
||||||
"@storybook/components": "8.0.0-beta.6",
|
"@storybook/components": "8.0.9",
|
||||||
"@storybook/core-events": "8.0.0-beta.6",
|
"@storybook/core-events": "8.0.9",
|
||||||
"@storybook/manager-api": "8.0.0-beta.6",
|
"@storybook/manager-api": "8.0.9",
|
||||||
"@storybook/preview-api": "8.0.0-beta.6",
|
"@storybook/preview-api": "8.0.9",
|
||||||
"@storybook/react": "8.0.0-beta.6",
|
"@storybook/react": "8.0.9",
|
||||||
"@storybook/react-vite": "8.0.0-beta.6",
|
"@storybook/react-vite": "8.0.9",
|
||||||
"@storybook/test": "8.0.0-beta.6",
|
"@storybook/test": "8.0.9",
|
||||||
"@storybook/theming": "8.0.0-beta.6",
|
"@storybook/theming": "8.0.9",
|
||||||
"@storybook/types": "8.0.0-beta.6",
|
"@storybook/types": "8.0.9",
|
||||||
"@storybook/vue3": "8.0.0-beta.6",
|
"@storybook/vue3": "8.0.9",
|
||||||
"@storybook/vue3-vite": "8.0.0-beta.6",
|
"@storybook/vue3-vite": "8.0.9",
|
||||||
"@testing-library/vue": "8.0.2",
|
"@testing-library/vue": "8.0.2",
|
||||||
"@types/escape-regexp": "0.0.3",
|
"@types/escape-regexp": "0.0.3",
|
||||||
"@types/estree": "1.0.5",
|
"@types/estree": "1.0.5",
|
||||||
|
@ -129,7 +129,7 @@
|
||||||
"react": "18.2.0",
|
"react": "18.2.0",
|
||||||
"react-dom": "18.2.0",
|
"react-dom": "18.2.0",
|
||||||
"start-server-and-test": "2.0.3",
|
"start-server-and-test": "2.0.3",
|
||||||
"storybook": "8.0.0-beta.6",
|
"storybook": "8.0.9",
|
||||||
"storybook-addon-misskey-theme": "github:misskey-dev/storybook-addon-misskey-theme",
|
"storybook-addon-misskey-theme": "github:misskey-dev/storybook-addon-misskey-theme",
|
||||||
"vite-plugin-turbosnap": "1.0.3",
|
"vite-plugin-turbosnap": "1.0.3",
|
||||||
"vitest": "0.34.6",
|
"vitest": "0.34.6",
|
||||||
|
|
|
@ -4,7 +4,10 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
||||||
|
import { action } from '@storybook/addon-actions';
|
||||||
import { StoryObj } from '@storybook/vue3';
|
import { StoryObj } from '@storybook/vue3';
|
||||||
|
import { HttpResponse, http } from 'msw';
|
||||||
|
import { commonHandlers } from '../../.storybook/mocks.js';
|
||||||
import { userDetailed } from '../../.storybook/fakes.js';
|
import { userDetailed } from '../../.storybook/fakes.js';
|
||||||
import MkAccountMoved from './MkAccountMoved.vue';
|
import MkAccountMoved from './MkAccountMoved.vue';
|
||||||
export const Default = {
|
export const Default = {
|
||||||
|
@ -29,10 +32,18 @@ export const Default = {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
args: {
|
args: {
|
||||||
username: userDetailed().username,
|
movedTo: userDetailed().id,
|
||||||
host: userDetailed().host,
|
|
||||||
},
|
},
|
||||||
parameters: {
|
parameters: {
|
||||||
layout: 'centered',
|
layout: 'centered',
|
||||||
|
msw: {
|
||||||
|
handlers: [
|
||||||
|
...commonHandlers,
|
||||||
|
http.post('/api/users/show', async ({ request }) => {
|
||||||
|
action('POST /api/users/show')(await request.json());
|
||||||
|
return HttpResponse.json(userDetailed());
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
} satisfies StoryObj<typeof MkAccountMoved>;
|
} satisfies StoryObj<typeof MkAccountMoved>;
|
||||||
|
|
|
@ -4,7 +4,10 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
||||||
|
import { action } from '@storybook/addon-actions';
|
||||||
import { StoryObj } from '@storybook/vue3';
|
import { StoryObj } from '@storybook/vue3';
|
||||||
|
import { HttpResponse, http } from 'msw';
|
||||||
|
import { commonHandlers } from '../../.storybook/mocks.js';
|
||||||
import MkAnnouncementDialog from './MkAnnouncementDialog.vue';
|
import MkAnnouncementDialog from './MkAnnouncementDialog.vue';
|
||||||
export const Default = {
|
export const Default = {
|
||||||
render(args) {
|
render(args) {
|
||||||
|
@ -23,8 +26,13 @@ export const Default = {
|
||||||
...this.args,
|
...this.args,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
events() {
|
||||||
|
return {
|
||||||
|
closed: action('closed'),
|
||||||
|
};
|
||||||
},
|
},
|
||||||
template: '<MkAnnouncementDialog v-bind="props" />',
|
},
|
||||||
|
template: '<MkAnnouncementDialog v-bind="props" v-on="events" />',
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
args: {
|
args: {
|
||||||
|
@ -38,10 +46,20 @@ export const Default = {
|
||||||
imageUrl: null,
|
imageUrl: null,
|
||||||
display: 'dialog',
|
display: 'dialog',
|
||||||
needConfirmationToRead: false,
|
needConfirmationToRead: false,
|
||||||
|
silence: false,
|
||||||
forYou: true,
|
forYou: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
parameters: {
|
parameters: {
|
||||||
layout: 'centered',
|
layout: 'centered',
|
||||||
|
msw: {
|
||||||
|
handlers: [
|
||||||
|
...commonHandlers,
|
||||||
|
http.post('/api/i/read-announcement', async ({ request }) => {
|
||||||
|
action('POST /api/i/read-announcement')(await request.json());
|
||||||
|
return HttpResponse.json();
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
},
|
||||||
},
|
},
|
||||||
} satisfies StoryObj<typeof MkAnnouncementDialog>;
|
} satisfies StoryObj<typeof MkAnnouncementDialog>;
|
||||||
|
|
|
@ -4,19 +4,11 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-if="meta" :class="$style.root" :style="{ backgroundImage: `url(${ meta.backgroundImageUrl })` }"></div>
|
<div v-if="instance" :class="$style.root" :style="{ backgroundImage: `url(${ instance.backgroundImageUrl })` }"></div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref } from 'vue';
|
import { instance } from '@/instance.js';
|
||||||
import * as Misskey from 'misskey-js';
|
|
||||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
|
||||||
|
|
||||||
const meta = ref<Misskey.entities.MetaResponse>();
|
|
||||||
|
|
||||||
misskeyApi('meta', { detail: true }).then(gotMeta => {
|
|
||||||
meta.value = gotMeta;
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" module>
|
<style lang="scss" module>
|
||||||
|
|
|
@ -156,6 +156,7 @@ const props = withDefaults(defineProps<{
|
||||||
initialVisibleUsers: () => [],
|
initialVisibleUsers: () => [],
|
||||||
autofocus: true,
|
autofocus: true,
|
||||||
mock: false,
|
mock: false,
|
||||||
|
initialLocalOnly: undefined,
|
||||||
});
|
});
|
||||||
|
|
||||||
provide('mock', props.mock);
|
provide('mock', props.mock);
|
||||||
|
@ -185,8 +186,8 @@ watch(showPreview, () => defaultStore.set('showPreview', showPreview.value));
|
||||||
const showAddMfmFunction = ref(defaultStore.state.enableQuickAddMfmFunction);
|
const showAddMfmFunction = ref(defaultStore.state.enableQuickAddMfmFunction);
|
||||||
watch(showAddMfmFunction, () => defaultStore.set('enableQuickAddMfmFunction', showAddMfmFunction.value));
|
watch(showAddMfmFunction, () => defaultStore.set('enableQuickAddMfmFunction', showAddMfmFunction.value));
|
||||||
const cw = ref<string | null>(props.initialCw ?? null);
|
const cw = ref<string | null>(props.initialCw ?? null);
|
||||||
const localOnly = ref<boolean>(props.initialLocalOnly ?? defaultStore.state.rememberNoteVisibility ? defaultStore.state.localOnly : defaultStore.state.defaultNoteLocalOnly);
|
const localOnly = ref(props.initialLocalOnly ?? (defaultStore.state.rememberNoteVisibility ? defaultStore.state.localOnly : defaultStore.state.defaultNoteLocalOnly));
|
||||||
const visibility = ref(props.initialVisibility ?? (defaultStore.state.rememberNoteVisibility ? defaultStore.state.visibility : defaultStore.state.defaultNoteVisibility) as typeof Misskey.noteVisibilities[number]);
|
const visibility = ref(props.initialVisibility ?? (defaultStore.state.rememberNoteVisibility ? defaultStore.state.visibility : defaultStore.state.defaultNoteVisibility));
|
||||||
const visibleUsers = ref<Misskey.entities.UserDetailed[]>([]);
|
const visibleUsers = ref<Misskey.entities.UserDetailed[]>([]);
|
||||||
if (props.initialVisibleUsers) {
|
if (props.initialVisibleUsers) {
|
||||||
props.initialVisibleUsers.forEach(pushVisibleUser);
|
props.initialVisibleUsers.forEach(pushVisibleUser);
|
||||||
|
@ -518,6 +519,9 @@ async function toggleLocalOnly() {
|
||||||
}
|
}
|
||||||
|
|
||||||
localOnly.value = !localOnly.value;
|
localOnly.value = !localOnly.value;
|
||||||
|
if (defaultStore.state.rememberNoteVisibility) {
|
||||||
|
defaultStore.set('localOnly', localOnly.value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function toggleReactionAcceptance() {
|
async function toggleReactionAcceptance() {
|
||||||
|
|
|
@ -15,7 +15,7 @@ import * as Misskey from 'misskey-js';
|
||||||
import MkModal from '@/components/MkModal.vue';
|
import MkModal from '@/components/MkModal.vue';
|
||||||
import MkPostForm from '@/components/MkPostForm.vue';
|
import MkPostForm from '@/components/MkPostForm.vue';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = withDefaults(defineProps<{
|
||||||
reply?: Misskey.entities.Note;
|
reply?: Misskey.entities.Note;
|
||||||
renote?: Misskey.entities.Note;
|
renote?: Misskey.entities.Note;
|
||||||
channel?: any; // TODO
|
channel?: any; // TODO
|
||||||
|
@ -31,7 +31,9 @@ const props = defineProps<{
|
||||||
instant?: boolean;
|
instant?: boolean;
|
||||||
fixed?: boolean;
|
fixed?: boolean;
|
||||||
autofocus?: boolean;
|
autofocus?: boolean;
|
||||||
}>();
|
}>(), {
|
||||||
|
initialLocalOnly: undefined,
|
||||||
|
});
|
||||||
|
|
||||||
const emit = defineEmits<{
|
const emit = defineEmits<{
|
||||||
(ev: 'closed'): void;
|
(ev: 'closed'): void;
|
||||||
|
|
|
@ -51,13 +51,16 @@ export const Empty = {
|
||||||
expect(buttons.at(-1)).toBeEnabled();
|
expect(buttons.at(-1)).toBeEnabled();
|
||||||
},
|
},
|
||||||
args: {
|
args: {
|
||||||
|
// @ts-expect-error serverRules is for test
|
||||||
serverRules: [],
|
serverRules: [],
|
||||||
tosUrl: null,
|
tosUrl: null,
|
||||||
},
|
},
|
||||||
decorators: [
|
decorators: [
|
||||||
(_, context) => ({
|
(_, context) => ({
|
||||||
setup() {
|
setup() {
|
||||||
|
// @ts-expect-error serverRules is for test
|
||||||
instance.serverRules = context.args.serverRules;
|
instance.serverRules = context.args.serverRules;
|
||||||
|
// @ts-expect-error tosUrl is for test
|
||||||
instance.tosUrl = context.args.tosUrl;
|
instance.tosUrl = context.args.tosUrl;
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
// FIXME: 呼び出されない
|
// FIXME: 呼び出されない
|
||||||
|
@ -76,6 +79,7 @@ export const ServerRulesOnly = {
|
||||||
...Empty,
|
...Empty,
|
||||||
args: {
|
args: {
|
||||||
...Empty.args,
|
...Empty.args,
|
||||||
|
// @ts-expect-error serverRules is for test
|
||||||
serverRules: [
|
serverRules: [
|
||||||
'ルール',
|
'ルール',
|
||||||
],
|
],
|
||||||
|
@ -85,6 +89,7 @@ export const TOSOnly = {
|
||||||
...Empty,
|
...Empty,
|
||||||
args: {
|
args: {
|
||||||
...Empty.args,
|
...Empty.args,
|
||||||
|
// @ts-expect-error tosUrl is for test
|
||||||
tosUrl: 'https://example.com/tos',
|
tosUrl: 'https://example.com/tos',
|
||||||
},
|
},
|
||||||
} satisfies StoryObj<typeof MkSignupServerRules>;
|
} satisfies StoryObj<typeof MkSignupServerRules>;
|
||||||
|
@ -92,6 +97,7 @@ export const ServerRulesAndTOS = {
|
||||||
...Empty,
|
...Empty,
|
||||||
args: {
|
args: {
|
||||||
...Empty.args,
|
...Empty.args,
|
||||||
|
// @ts-expect-error serverRules is for test
|
||||||
serverRules: ServerRulesOnly.args.serverRules,
|
serverRules: ServerRulesOnly.args.serverRules,
|
||||||
tosUrl: TOSOnly.args.tosUrl,
|
tosUrl: TOSOnly.args.tosUrl,
|
||||||
},
|
},
|
||||||
|
|
|
@ -4,19 +4,19 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-if="meta" :class="$style.root">
|
<div v-if="instance" :class="$style.root">
|
||||||
<div :class="[$style.main, $style.panel]">
|
<div :class="[$style.main, $style.panel]">
|
||||||
<img :src="instance.iconUrl || '/favicon.ico'" alt="" :class="$style.mainIcon"/>
|
<img :src="instance.iconUrl || '/favicon.ico'" alt="" :class="$style.mainIcon"/>
|
||||||
<button class="_button _acrylic" :class="$style.mainMenu" @click="showMenu"><i class="ti ti-dots"></i></button>
|
<button class="_button _acrylic" :class="$style.mainMenu" @click="showMenu"><i class="ti ti-dots"></i></button>
|
||||||
<div :class="$style.mainFg">
|
<div :class="$style.mainFg">
|
||||||
<h1 :class="$style.mainTitle">
|
<h1 :class="$style.mainTitle">
|
||||||
<!-- 背景色によってはロゴが見えなくなるのでとりあえず無効に -->
|
<!-- 背景色によってはロゴが見えなくなるのでとりあえず無効に -->
|
||||||
<!-- <img class="logo" v-if="meta.logoImageUrl" :src="meta.logoImageUrl"><span v-else class="text">{{ instanceName }}</span> -->
|
<!-- <img class="logo" v-if="instance.logoImageUrl" :src="instance.logoImageUrl"><span v-else class="text">{{ instanceName }}</span> -->
|
||||||
<span>{{ instanceName }}</span>
|
<span>{{ instanceName }}</span>
|
||||||
</h1>
|
</h1>
|
||||||
<div :class="$style.mainAbout">
|
<div :class="$style.mainAbout">
|
||||||
<!-- eslint-disable-next-line vue/no-v-html -->
|
<!-- eslint-disable-next-line vue/no-v-html -->
|
||||||
<div v-html="meta.description || i18n.ts.headlineMisskey"></div>
|
<div v-html="instance.description || i18n.ts.headlineMisskey"></div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="instance.disableRegistration" :class="$style.mainWarn">
|
<div v-if="instance.disableRegistration" :class="$style.mainWarn">
|
||||||
<MkInfo warn>{{ i18n.ts.invitationRequiredToRegister }}</MkInfo>
|
<MkInfo warn>{{ i18n.ts.invitationRequiredToRegister }}</MkInfo>
|
||||||
|
@ -65,14 +65,10 @@ import { i18n } from '@/i18n.js';
|
||||||
import { instance } from '@/instance.js';
|
import { instance } from '@/instance.js';
|
||||||
import MkNumber from '@/components/MkNumber.vue';
|
import MkNumber from '@/components/MkNumber.vue';
|
||||||
import XActiveUsersChart from '@/components/MkVisitorDashboard.ActiveUsersChart.vue';
|
import XActiveUsersChart from '@/components/MkVisitorDashboard.ActiveUsersChart.vue';
|
||||||
|
import { openInstanceMenu } from '@/ui/_common_/common';
|
||||||
|
|
||||||
const meta = ref<Misskey.entities.MetaResponse | null>(null);
|
|
||||||
const stats = ref<Misskey.entities.StatsResponse | null>(null);
|
const stats = ref<Misskey.entities.StatsResponse | null>(null);
|
||||||
|
|
||||||
misskeyApi('meta', { detail: true }).then(_meta => {
|
|
||||||
meta.value = _meta;
|
|
||||||
});
|
|
||||||
|
|
||||||
misskeyApi('stats', {}).then((res) => {
|
misskeyApi('stats', {}).then((res) => {
|
||||||
stats.value = res;
|
stats.value = res;
|
||||||
});
|
});
|
||||||
|
@ -90,43 +86,7 @@ function signup() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function showMenu(ev) {
|
function showMenu(ev) {
|
||||||
os.popupMenu([{
|
openInstanceMenu(ev);
|
||||||
text: i18n.ts.instanceInfo,
|
|
||||||
icon: 'ti ti-info-circle',
|
|
||||||
action: () => {
|
|
||||||
os.pageWindow('/about');
|
|
||||||
},
|
|
||||||
}, {
|
|
||||||
text: i18n.ts.aboutMisskey,
|
|
||||||
icon: 'ti ti-info-circle',
|
|
||||||
action: () => {
|
|
||||||
os.pageWindow('/about-misskey');
|
|
||||||
},
|
|
||||||
}, { type: 'divider' }, (instance.impressumUrl) ? {
|
|
||||||
text: i18n.ts.impressum,
|
|
||||||
icon: 'ti ti-file-invoice',
|
|
||||||
action: () => {
|
|
||||||
window.open(instance.impressumUrl!, '_blank', 'noopener');
|
|
||||||
},
|
|
||||||
} : undefined, (instance.tosUrl) ? {
|
|
||||||
text: i18n.ts.termsOfService,
|
|
||||||
icon: 'ti ti-notebook',
|
|
||||||
action: () => {
|
|
||||||
window.open(instance.tosUrl!, '_blank', 'noopener');
|
|
||||||
},
|
|
||||||
} : undefined, (instance.privacyPolicyUrl) ? {
|
|
||||||
text: i18n.ts.privacyPolicy,
|
|
||||||
icon: 'ti ti-shield-lock',
|
|
||||||
action: () => {
|
|
||||||
window.open(instance.privacyPolicyUrl!, '_blank', 'noopener');
|
|
||||||
},
|
|
||||||
} : undefined, (!instance.impressumUrl && !instance.tosUrl && !instance.privacyPolicyUrl) ? undefined : { type: 'divider' }, {
|
|
||||||
text: i18n.ts.help,
|
|
||||||
icon: 'ti ti-help-circle',
|
|
||||||
action: () => {
|
|
||||||
window.open('https://misskey-hub.net/docs/for-users/', '_blank', 'noopener');
|
|
||||||
},
|
|
||||||
}], ev.currentTarget ?? ev.target);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function exploreOtherServers() {
|
function exploreOtherServers() {
|
||||||
|
|
|
@ -4,8 +4,10 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
/* eslint-disable @typescript-eslint/explicit-function-return-type */
|
||||||
|
import { expect, userEvent, waitFor, within } from '@storybook/test';
|
||||||
import { StoryObj } from '@storybook/vue3';
|
import { StoryObj } from '@storybook/vue3';
|
||||||
import MkAd from './MkAd.vue';
|
import MkAd from './MkAd.vue';
|
||||||
|
import { i18n } from '@/i18n.js';
|
||||||
|
|
||||||
let lock: Promise<undefined> | undefined;
|
let lock: Promise<undefined> | undefined;
|
||||||
|
|
||||||
|
@ -30,7 +32,6 @@ const common = {
|
||||||
template: '<MkAd v-bind="props" />',
|
template: '<MkAd v-bind="props" />',
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
/* FIXME: disabled because it still didn’t pass after applying #11267
|
|
||||||
async play({ canvasElement, args }) {
|
async play({ canvasElement, args }) {
|
||||||
if (lock) {
|
if (lock) {
|
||||||
console.warn('This test is unexpectedly running twice in parallel, fix it!');
|
console.warn('This test is unexpectedly running twice in parallel, fix it!');
|
||||||
|
@ -44,7 +45,7 @@ const common = {
|
||||||
try {
|
try {
|
||||||
const canvas = within(canvasElement);
|
const canvas = within(canvasElement);
|
||||||
const a = canvas.getByRole<HTMLAnchorElement>('link');
|
const a = canvas.getByRole<HTMLAnchorElement>('link');
|
||||||
await expect(a.href).toMatch(/^https?:\/\/.*#test$/);
|
// await expect(a.href).toMatch(/^https?:\/\/.*#test$/);
|
||||||
const img = within(a).getByRole('img');
|
const img = within(a).getByRole('img');
|
||||||
await expect(img).toBeInTheDocument();
|
await expect(img).toBeInTheDocument();
|
||||||
let buttons = canvas.getAllByRole<HTMLButtonElement>('button');
|
let buttons = canvas.getAllByRole<HTMLButtonElement>('button');
|
||||||
|
@ -52,13 +53,14 @@ const common = {
|
||||||
const i = buttons[0];
|
const i = buttons[0];
|
||||||
await expect(i).toBeInTheDocument();
|
await expect(i).toBeInTheDocument();
|
||||||
await userEvent.click(i);
|
await userEvent.click(i);
|
||||||
await waitFor(() => expect(canvasElement).toHaveTextContent(i18n.ts._ad.back));
|
// await expect(canvasElement).toHaveTextContent(i18n.ts._ad.back);
|
||||||
await expect(a).not.toBeInTheDocument();
|
await expect(a).not.toBeInTheDocument();
|
||||||
await expect(i).not.toBeInTheDocument();
|
await expect(i).not.toBeInTheDocument();
|
||||||
buttons = canvas.getAllByRole<HTMLButtonElement>('button');
|
buttons = canvas.getAllByRole<HTMLButtonElement>('button');
|
||||||
await expect(buttons).toHaveLength(args.__hasReduce ? 2 : 1);
|
const hasReduceFrequency = args.specify?.ratio !== 0;
|
||||||
const reduce = args.__hasReduce ? buttons[0] : null;
|
await expect(buttons).toHaveLength(hasReduceFrequency ? 2 : 1);
|
||||||
const back = buttons[args.__hasReduce ? 1 : 0];
|
const reduce = hasReduceFrequency ? buttons[0] : null;
|
||||||
|
const back = buttons[hasReduceFrequency ? 1 : 0];
|
||||||
if (reduce) {
|
if (reduce) {
|
||||||
await expect(reduce).toBeInTheDocument();
|
await expect(reduce).toBeInTheDocument();
|
||||||
await expect(reduce).toHaveTextContent(i18n.ts._ad.reduceFrequencyOfThisAd);
|
await expect(reduce).toHaveTextContent(i18n.ts._ad.reduceFrequencyOfThisAd);
|
||||||
|
@ -80,15 +82,16 @@ const common = {
|
||||||
lock = undefined;
|
lock = undefined;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
*/
|
|
||||||
args: {
|
args: {
|
||||||
prefer: [],
|
prefer: [],
|
||||||
specify: {
|
specify: {
|
||||||
id: 'someadid',
|
id: 'someadid',
|
||||||
radio: 1,
|
ratio: 1,
|
||||||
url: '#test',
|
url: '#test',
|
||||||
|
place: '',
|
||||||
|
imageUrl: '',
|
||||||
|
dayOfWeek: 7,
|
||||||
},
|
},
|
||||||
__hasReduce: true,
|
|
||||||
},
|
},
|
||||||
parameters: {
|
parameters: {
|
||||||
layout: 'centered',
|
layout: 'centered',
|
||||||
|
@ -138,6 +141,5 @@ export const ZeroRatio = {
|
||||||
...Square.args.specify,
|
...Square.args.specify,
|
||||||
ratio: 0,
|
ratio: 0,
|
||||||
},
|
},
|
||||||
__hasReduce: false,
|
|
||||||
},
|
},
|
||||||
} satisfies StoryObj<typeof MkAd>;
|
} satisfies StoryObj<typeof MkAd>;
|
||||||
|
|
|
@ -33,7 +33,7 @@ const common = {
|
||||||
},
|
},
|
||||||
decorators: [
|
decorators: [
|
||||||
(Story, context) => ({
|
(Story, context) => ({
|
||||||
// eslint-disable-next-line quotes
|
// @ts-expect-error size is for test
|
||||||
template: `<div :style="{ display: 'grid', width: '${context.args.size}px', height: '${context.args.size}px' }"><story/></div>`,
|
template: `<div :style="{ display: 'grid', width: '${context.args.size}px', height: '${context.args.size}px' }"><story/></div>`,
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
|
@ -45,6 +45,7 @@ export const ProfilePage = {
|
||||||
...common,
|
...common,
|
||||||
args: {
|
args: {
|
||||||
...common.args,
|
...common.args,
|
||||||
|
// @ts-expect-error size is for test
|
||||||
size: 120,
|
size: 120,
|
||||||
indicator: true,
|
indicator: true,
|
||||||
},
|
},
|
||||||
|
|
|
@ -28,6 +28,7 @@ export const Default = {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
args: {
|
args: {
|
||||||
|
// @ts-expect-error text is for test
|
||||||
text: 'This is a condensed line.',
|
text: 'This is a condensed line.',
|
||||||
},
|
},
|
||||||
parameters: {
|
parameters: {
|
||||||
|
@ -41,4 +42,5 @@ export const ContainerIs100px = {
|
||||||
template: '<div style="width: 100px;"><story/></div>',
|
template: '<div style="width: 100px;"><story/></div>',
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
|
// @ts-expect-error text is for test
|
||||||
} satisfies StoryObj<typeof MkCondensedLine>;
|
} satisfies StoryObj<typeof MkCondensedLine>;
|
||||||
|
|
|
@ -3,8 +3,11 @@
|
||||||
* SPDX-License-Identifier: AGPL-3.0-only
|
* SPDX-License-Identifier: AGPL-3.0-only
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { Meta } from '@storybook/vue3';
|
||||||
|
import MkError from './MkError.vue';
|
||||||
|
|
||||||
export const argTypes = {
|
export const argTypes = {
|
||||||
retry: {
|
onRetry: {
|
||||||
action: 'retry',
|
action: 'retry',
|
||||||
},
|
},
|
||||||
};
|
} satisfies Meta<typeof MkError>['argTypes'];
|
||||||
|
|
|
@ -33,7 +33,6 @@ export const Empty = {
|
||||||
await waitFor(async () => await wait);
|
await waitFor(async () => await wait);
|
||||||
},
|
},
|
||||||
args: {
|
args: {
|
||||||
static: true,
|
|
||||||
tabs: [],
|
tabs: [],
|
||||||
},
|
},
|
||||||
parameters: {
|
parameters: {
|
||||||
|
@ -71,8 +70,8 @@ export const IconOnly = {
|
||||||
...Icon.args,
|
...Icon.args,
|
||||||
tabs: [
|
tabs: [
|
||||||
{
|
{
|
||||||
...Icon.args.tabs[0],
|
key: Icon.args.tabs[0].key,
|
||||||
title: undefined,
|
icon: Icon.args.tabs[0].icon,
|
||||||
iconOnly: true,
|
iconOnly: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
|
@ -38,7 +38,6 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
export type Tab = {
|
export type Tab = {
|
||||||
key: string;
|
key: string;
|
||||||
title: string;
|
|
||||||
onClick?: (ev: MouseEvent) => void;
|
onClick?: (ev: MouseEvent) => void;
|
||||||
} & (
|
} & (
|
||||||
| {
|
| {
|
||||||
|
|
|
@ -60,7 +60,7 @@ export const RelativeFuture = {
|
||||||
export const AbsoluteFuture = {
|
export const AbsoluteFuture = {
|
||||||
...Empty,
|
...Empty,
|
||||||
async play({ canvasElement, args }) {
|
async play({ canvasElement, args }) {
|
||||||
await expect(canvasElement).toHaveTextContent(dateTimeFormat.format(args.time));
|
await expect(canvasElement).toHaveTextContent(dateTimeFormat.format(typeof args.time === 'string' ? new Date(args.time) : args.time ?? undefined));
|
||||||
},
|
},
|
||||||
args: {
|
args: {
|
||||||
...Empty.args,
|
...Empty.args,
|
||||||
|
@ -97,7 +97,7 @@ export const RelativeNow = {
|
||||||
export const AbsoluteNow = {
|
export const AbsoluteNow = {
|
||||||
...Empty,
|
...Empty,
|
||||||
async play({ canvasElement, args }) {
|
async play({ canvasElement, args }) {
|
||||||
await expect(canvasElement).toHaveTextContent(dateTimeFormat.format(args.time));
|
await expect(canvasElement).toHaveTextContent(dateTimeFormat.format(typeof args.time === 'string' ? new Date(args.time) : args.time ?? undefined));
|
||||||
},
|
},
|
||||||
args: {
|
args: {
|
||||||
...Empty.args,
|
...Empty.args,
|
||||||
|
@ -136,7 +136,7 @@ export const RelativeOneHourAgo = {
|
||||||
export const AbsoluteOneHourAgo = {
|
export const AbsoluteOneHourAgo = {
|
||||||
...Empty,
|
...Empty,
|
||||||
async play({ canvasElement, args }) {
|
async play({ canvasElement, args }) {
|
||||||
await expect(canvasElement).toHaveTextContent(dateTimeFormat.format(args.time));
|
await expect(canvasElement).toHaveTextContent(dateTimeFormat.format(typeof args.time === 'string' ? new Date(args.time) : args.time ?? undefined));
|
||||||
},
|
},
|
||||||
args: {
|
args: {
|
||||||
...Empty.args,
|
...Empty.args,
|
||||||
|
@ -175,7 +175,7 @@ export const RelativeOneDayAgo = {
|
||||||
export const AbsoluteOneDayAgo = {
|
export const AbsoluteOneDayAgo = {
|
||||||
...Empty,
|
...Empty,
|
||||||
async play({ canvasElement, args }) {
|
async play({ canvasElement, args }) {
|
||||||
await expect(canvasElement).toHaveTextContent(dateTimeFormat.format(args.time));
|
await expect(canvasElement).toHaveTextContent(dateTimeFormat.format(typeof args.time === 'string' ? new Date(args.time) : args.time ?? undefined));
|
||||||
},
|
},
|
||||||
args: {
|
args: {
|
||||||
...Empty.args,
|
...Empty.args,
|
||||||
|
@ -214,7 +214,7 @@ export const RelativeOneWeekAgo = {
|
||||||
export const AbsoluteOneWeekAgo = {
|
export const AbsoluteOneWeekAgo = {
|
||||||
...Empty,
|
...Empty,
|
||||||
async play({ canvasElement, args }) {
|
async play({ canvasElement, args }) {
|
||||||
await expect(canvasElement).toHaveTextContent(dateTimeFormat.format(args.time));
|
await expect(canvasElement).toHaveTextContent(dateTimeFormat.format(typeof args.time === 'string' ? new Date(args.time) : args.time ?? undefined));
|
||||||
},
|
},
|
||||||
args: {
|
args: {
|
||||||
...Empty.args,
|
...Empty.args,
|
||||||
|
@ -253,7 +253,7 @@ export const RelativeOneMonthAgo = {
|
||||||
export const AbsoluteOneMonthAgo = {
|
export const AbsoluteOneMonthAgo = {
|
||||||
...Empty,
|
...Empty,
|
||||||
async play({ canvasElement, args }) {
|
async play({ canvasElement, args }) {
|
||||||
await expect(canvasElement).toHaveTextContent(dateTimeFormat.format(args.time));
|
await expect(canvasElement).toHaveTextContent(dateTimeFormat.format(typeof args.time === 'string' ? new Date(args.time) : args.time ?? undefined));
|
||||||
},
|
},
|
||||||
args: {
|
args: {
|
||||||
...Empty.args,
|
...Empty.args,
|
||||||
|
@ -292,7 +292,7 @@ export const RelativeOneYearAgo = {
|
||||||
export const AbsoluteOneYearAgo = {
|
export const AbsoluteOneYearAgo = {
|
||||||
...Empty,
|
...Empty,
|
||||||
async play({ canvasElement, args }) {
|
async play({ canvasElement, args }) {
|
||||||
await expect(canvasElement).toHaveTextContent(dateTimeFormat.format(args.time));
|
await expect(canvasElement).toHaveTextContent(dateTimeFormat.format(typeof args.time === 'string' ? new Date(args.time) : args.time ?? undefined));
|
||||||
},
|
},
|
||||||
args: {
|
args: {
|
||||||
...Empty.args,
|
...Empty.args,
|
||||||
|
|
|
@ -30,7 +30,7 @@ export const Default = {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
async play({ canvasElement }) {
|
async play({ canvasElement }) {
|
||||||
await expect(canvasElement).toHaveTextContent(userDetailed().name);
|
await expect(canvasElement).toHaveTextContent(userDetailed().name as string);
|
||||||
},
|
},
|
||||||
args: {
|
args: {
|
||||||
user: userDetailed(),
|
user: userDetailed(),
|
||||||
|
|
|
@ -28,7 +28,7 @@ if (providedAt > cachedAt) {
|
||||||
|
|
||||||
// TODO: instanceをリアクティブにするかは再考の余地あり
|
// TODO: instanceをリアクティブにするかは再考の余地あり
|
||||||
|
|
||||||
export const instance: Misskey.entities.MetaResponse = reactive(cachedMeta ?? {});
|
export const instance: Misskey.entities.MetaDetailed = reactive(cachedMeta ?? {});
|
||||||
|
|
||||||
export const serverErrorImageUrl = computed(() => instance.serverErrorImageUrl ?? DEFAULT_SERVER_ERROR_IMAGE_URL);
|
export const serverErrorImageUrl = computed(() => instance.serverErrorImageUrl ?? DEFAULT_SERVER_ERROR_IMAGE_URL);
|
||||||
|
|
||||||
|
@ -38,17 +38,17 @@ export const notFoundImageUrl = computed(() => instance.notFoundImageUrl ?? DEFA
|
||||||
|
|
||||||
export const isEnabledUrlPreview = computed(() => instance.enableUrlPreview ?? true);
|
export const isEnabledUrlPreview = computed(() => instance.enableUrlPreview ?? true);
|
||||||
|
|
||||||
export async function fetchInstance(force = false): Promise<void> {
|
export async function fetchInstance(force = false): Promise<Misskey.entities.MetaDetailed> {
|
||||||
if (!force) {
|
if (!force) {
|
||||||
const cachedAt = miLocalStorage.getItem('instanceCachedAt') ? parseInt(miLocalStorage.getItem('instanceCachedAt')!) : 0;
|
const cachedAt = miLocalStorage.getItem('instanceCachedAt') ? parseInt(miLocalStorage.getItem('instanceCachedAt')!) : 0;
|
||||||
|
|
||||||
if (Date.now() - cachedAt < 1000 * 60 * 60) {
|
if (Date.now() - cachedAt < 1000 * 60 * 60) {
|
||||||
return;
|
return instance;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const meta = await misskeyApi('meta', {
|
const meta = await misskeyApi('meta', {
|
||||||
detail: false,
|
detail: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
for (const [k, v] of Object.entries(meta)) {
|
for (const [k, v] of Object.entries(meta)) {
|
||||||
|
@ -57,4 +57,6 @@ export async function fetchInstance(force = false): Promise<void> {
|
||||||
|
|
||||||
miLocalStorage.setItem('instance', JSON.stringify(instance));
|
miLocalStorage.setItem('instance', JSON.stringify(instance));
|
||||||
miLocalStorage.setItem('instanceCachedAt', Date.now().toString());
|
miLocalStorage.setItem('instanceCachedAt', Date.now().toString());
|
||||||
|
|
||||||
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
<!--
|
||||||
|
SPDX-FileCopyrightText: syuilo and misskey-project
|
||||||
|
SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
-->
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<MkStickyContainer>
|
||||||
|
<template #header><MkPageHeader/></template>
|
||||||
|
<MkSpacer :contentMax="600" :marginMin="20">
|
||||||
|
<div>{{ instance.maintainerEmail }}</div>
|
||||||
|
</MkSpacer>
|
||||||
|
</MkStickyContainer>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { i18n } from '@/i18n.js';
|
||||||
|
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||||
|
import { instance } from '@/instance.js';
|
||||||
|
|
||||||
|
definePageMetadata(() => ({
|
||||||
|
title: i18n.ts.inquiry,
|
||||||
|
icon: 'ti ti-help-circle',
|
||||||
|
}));
|
||||||
|
</script>
|
|
@ -42,11 +42,11 @@ import XTimeline from './welcome.timeline.vue';
|
||||||
import MarqueeText from '@/components/MkMarquee.vue';
|
import MarqueeText from '@/components/MkMarquee.vue';
|
||||||
import MkFeaturedPhotos from '@/components/MkFeaturedPhotos.vue';
|
import MkFeaturedPhotos from '@/components/MkFeaturedPhotos.vue';
|
||||||
import misskeysvg from '/client-assets/misskey.svg';
|
import misskeysvg from '/client-assets/misskey.svg';
|
||||||
import { misskeyApi, misskeyApiGet } from '@/scripts/misskey-api.js';
|
import { misskeyApiGet } from '@/scripts/misskey-api.js';
|
||||||
import MkVisitorDashboard from '@/components/MkVisitorDashboard.vue';
|
import MkVisitorDashboard from '@/components/MkVisitorDashboard.vue';
|
||||||
import { getProxiedImageUrl } from '@/scripts/media-proxy.js';
|
import { getProxiedImageUrl } from '@/scripts/media-proxy.js';
|
||||||
|
import { instance as meta } from '@/instance.js';
|
||||||
|
|
||||||
const meta = ref<Misskey.entities.MetaResponse>();
|
|
||||||
const instances = ref<Misskey.entities.FederationInstance[]>();
|
const instances = ref<Misskey.entities.FederationInstance[]>();
|
||||||
|
|
||||||
function getInstanceIcon(instance: Misskey.entities.FederationInstance): string {
|
function getInstanceIcon(instance: Misskey.entities.FederationInstance): string {
|
||||||
|
@ -56,10 +56,6 @@ function getInstanceIcon(instance: Misskey.entities.FederationInstance): string
|
||||||
return getProxiedImageUrl(instance.iconUrl, 'preview');
|
return getProxiedImageUrl(instance.iconUrl, 'preview');
|
||||||
}
|
}
|
||||||
|
|
||||||
misskeyApi('meta', { detail: true }).then(_meta => {
|
|
||||||
meta.value = _meta;
|
|
||||||
});
|
|
||||||
|
|
||||||
misskeyApiGet('federation/instances', {
|
misskeyApiGet('federation/instances', {
|
||||||
sort: '+pubSub',
|
sort: '+pubSub',
|
||||||
limit: 20,
|
limit: 20,
|
||||||
|
|
|
@ -4,8 +4,8 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-if="meta">
|
<div v-if="instance">
|
||||||
<XSetup v-if="meta.requireSetup"/>
|
<XSetup v-if="instance.requireSetup"/>
|
||||||
<XEntrance v-else/>
|
<XEntrance v-else/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -16,13 +16,13 @@ import * as Misskey from 'misskey-js';
|
||||||
import XSetup from './welcome.setup.vue';
|
import XSetup from './welcome.setup.vue';
|
||||||
import XEntrance from './welcome.entrance.a.vue';
|
import XEntrance from './welcome.entrance.a.vue';
|
||||||
import { instanceName } from '@/config.js';
|
import { instanceName } from '@/config.js';
|
||||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
|
||||||
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
import { definePageMetadata } from '@/scripts/page-metadata.js';
|
||||||
|
import { fetchInstance } from '@/instance.js';
|
||||||
|
|
||||||
const meta = ref<Misskey.entities.MetaResponse | null>(null);
|
const instance = ref<Misskey.entities.MetaDetailed | null>(null);
|
||||||
|
|
||||||
misskeyApi('meta', { detail: true }).then(res => {
|
fetchInstance(true).then((res) => {
|
||||||
meta.value = res;
|
instance.value = res;
|
||||||
});
|
});
|
||||||
|
|
||||||
const headerActions = computed(() => []);
|
const headerActions = computed(() => []);
|
||||||
|
|
|
@ -197,6 +197,9 @@ const routes: RouteDef[] = [{
|
||||||
path: '/about',
|
path: '/about',
|
||||||
component: page(() => import('@/pages/about.vue')),
|
component: page(() => import('@/pages/about.vue')),
|
||||||
hash: 'initialTab',
|
hash: 'initialTab',
|
||||||
|
}, {
|
||||||
|
path: '/contact',
|
||||||
|
component: page(() => import('@/pages/contact.vue')),
|
||||||
}, {
|
}, {
|
||||||
path: '/about-misskey',
|
path: '/about-misskey',
|
||||||
component: page(() => import('@/pages/about-misskey.vue')),
|
component: page(() => import('@/pages/about-misskey.vue')),
|
||||||
|
|
|
@ -504,10 +504,9 @@ export function getNoteMenu(props: {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
type Visibility = 'public' | 'home' | 'followers' | 'specified';
|
type Visibility = (typeof Misskey.noteVisibilities)[number];
|
||||||
|
|
||||||
// defaultStore.state.visibilityがstringなためstringも受け付けている
|
function smallerVisibility(a: Visibility, b: Visibility): Visibility {
|
||||||
function smallerVisibility(a: Visibility | string, b: Visibility | string): Visibility {
|
|
||||||
if (a === 'specified' || b === 'specified') return 'specified';
|
if (a === 'specified' || b === 'specified') return 'specified';
|
||||||
if (a === 'followers' || b === 'followers') return 'followers';
|
if (a === 'followers' || b === 'followers') return 'followers';
|
||||||
if (a === 'home' || b === 'home') return 'home';
|
if (a === 'home' || b === 'home') return 'home';
|
||||||
|
|
|
@ -94,7 +94,7 @@ export const defaultStore = markRaw(new Storage('base', {
|
||||||
},
|
},
|
||||||
defaultNoteVisibility: {
|
defaultNoteVisibility: {
|
||||||
where: 'account',
|
where: 'account',
|
||||||
default: 'public',
|
default: 'public' as (typeof Misskey.noteVisibilities)[number],
|
||||||
},
|
},
|
||||||
defaultNoteLocalOnly: {
|
defaultNoteLocalOnly: {
|
||||||
where: 'account',
|
where: 'account',
|
||||||
|
@ -150,7 +150,7 @@ export const defaultStore = markRaw(new Storage('base', {
|
||||||
},
|
},
|
||||||
visibility: {
|
visibility: {
|
||||||
where: 'deviceAccount',
|
where: 'deviceAccount',
|
||||||
default: 'public' as 'public' | 'home' | 'followers' | 'specified',
|
default: 'public' as (typeof Misskey.noteVisibilities)[number],
|
||||||
},
|
},
|
||||||
localOnly: {
|
localOnly: {
|
||||||
where: 'deviceAccount',
|
where: 'deviceAccount',
|
||||||
|
|
|
@ -79,7 +79,12 @@ export function openInstanceMenu(ev: MouseEvent) {
|
||||||
text: i18n.ts.tools,
|
text: i18n.ts.tools,
|
||||||
icon: 'ti ti-tool',
|
icon: 'ti ti-tool',
|
||||||
children: toolsMenuItems(),
|
children: toolsMenuItems(),
|
||||||
}, { type: 'divider' }, (instance.impressumUrl) ? {
|
}, { type: 'divider' }, {
|
||||||
|
type: 'link',
|
||||||
|
text: i18n.ts.inquiry,
|
||||||
|
icon: 'ti ti-help-circle',
|
||||||
|
to: '/contact',
|
||||||
|
}, (instance.impressumUrl) ? {
|
||||||
text: i18n.ts.impressum,
|
text: i18n.ts.impressum,
|
||||||
icon: 'ti ti-file-invoice',
|
icon: 'ti ti-file-invoice',
|
||||||
action: () => {
|
action: () => {
|
||||||
|
@ -98,8 +103,8 @@ export function openInstanceMenu(ev: MouseEvent) {
|
||||||
window.open(instance.privacyPolicyUrl, '_blank', 'noopener');
|
window.open(instance.privacyPolicyUrl, '_blank', 'noopener');
|
||||||
},
|
},
|
||||||
} : undefined, (!instance.impressumUrl && !instance.tosUrl && !instance.privacyPolicyUrl) ? undefined : { type: 'divider' }, {
|
} : undefined, (!instance.impressumUrl && !instance.tosUrl && !instance.privacyPolicyUrl) ? undefined : { type: 'divider' }, {
|
||||||
text: i18n.ts.help,
|
text: i18n.ts.document,
|
||||||
icon: 'ti ti-help-circle',
|
icon: 'ti ti-bulb',
|
||||||
action: () => {
|
action: () => {
|
||||||
window.open('https://misskey-hub.net/docs/for-users/', '_blank', 'noopener');
|
window.open('https://misskey-hub.net/docs/for-users/', '_blank', 'noopener');
|
||||||
},
|
},
|
||||||
|
|
|
@ -70,11 +70,9 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onMounted, provide, ref, computed } from 'vue';
|
import { onMounted, provide, ref, computed } from 'vue';
|
||||||
import * as Misskey from 'misskey-js';
|
|
||||||
import XCommon from './_common_/common.vue';
|
import XCommon from './_common_/common.vue';
|
||||||
import { instanceName } from '@/config.js';
|
import { instanceName } from '@/config.js';
|
||||||
import * as os from '@/os.js';
|
import * as os from '@/os.js';
|
||||||
import { misskeyApi } from '@/scripts/misskey-api.js';
|
|
||||||
import { instance } from '@/instance.js';
|
import { instance } from '@/instance.js';
|
||||||
import XSigninDialog from '@/components/MkSigninDialog.vue';
|
import XSigninDialog from '@/components/MkSigninDialog.vue';
|
||||||
import XSignupDialog from '@/components/MkSignupDialog.vue';
|
import XSignupDialog from '@/components/MkSignupDialog.vue';
|
||||||
|
@ -114,7 +112,6 @@ const isTimelineAvailable = ref(instance.policies?.ltlAvailable || instance.poli
|
||||||
const showMenu = ref(false);
|
const showMenu = ref(false);
|
||||||
const isDesktop = ref(window.innerWidth >= DESKTOP_THRESHOLD);
|
const isDesktop = ref(window.innerWidth >= DESKTOP_THRESHOLD);
|
||||||
const narrow = ref(window.innerWidth < 1280);
|
const narrow = ref(window.innerWidth < 1280);
|
||||||
const meta = ref<Misskey.entities.MetaResponse>();
|
|
||||||
|
|
||||||
const keymap = computed(() => {
|
const keymap = computed(() => {
|
||||||
return {
|
return {
|
||||||
|
@ -128,10 +125,6 @@ const keymap = computed(() => {
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
misskeyApi('meta', { detail: true }).then(res => {
|
|
||||||
meta.value = res;
|
|
||||||
});
|
|
||||||
|
|
||||||
function signin() {
|
function signin() {
|
||||||
os.popup(XSigninDialog, {
|
os.popup(XSigninDialog, {
|
||||||
autoSet: true,
|
autoSet: true,
|
||||||
|
|
1508
pnpm-lock.yaml
1508
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue