Merge branch 'develop' into removed-note-metadata

This commit is contained in:
anatawa12 2025-08-09 14:31:46 +09:00 committed by GitHub
commit 2bd3c9f96b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
42 changed files with 1093 additions and 626 deletions

View File

@ -32,15 +32,20 @@
- Feat: ページのタブバーを下部に表示できるように
- Enhance: コントロールパネルを検索できるように
- Enhance: トルコ語 (tr-TR) に対応
- Enhance: 言語別のスクリプトバンドルを生成するように
- Enhance: 不必要な翻訳データを読み込まなくなり、パフォーマンスが向上しました
- Enhance: 画像エフェクトのパラメータ名の多言語対応
- Enhance: 依存ソフトウェアの更新
- Fix: 投稿フォームでファイルのアップロードが中止または失敗した際のハンドリングを修正
- Fix: 一部の設定検索結果が存在しないパスになる問題を修正
(Cherry-picked from https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/1171)
- Fix: テーマエディタが動作しない問題を修正
- Fix: チャンネルのハイライトページにノートが表示されない問題を修正
- Fix: カラムの名前が正しくリスト/チャンネルの名前にならない問題を修正
### Server
- Enhance: ノートの削除処理の効率化
- Enhance: 全体的なパフォーマンスの向上
- Enhance: 依存ソフトウェアの更新
- Fix: SystemWebhook設定でsecretを空に出来ない問題を修正

138
locales/index.d.ts vendored
View File

@ -12203,6 +12203,10 @@ export interface Locale extends ILocale {
*
*/
"advanced": string;
/**
*
*/
"angle": string;
/**
*
*/
@ -12215,10 +12219,6 @@ export interface Locale extends ILocale {
*
*/
"stripeFrequency": string;
/**
*
*/
"angle": string;
/**
*
*/
@ -12261,6 +12261,10 @@ export interface Locale extends ILocale {
*
*/
"discardChangesConfirm": string;
/**
*
*/
"nothingToConfigure": string;
"_fxs": {
/**
*
@ -12327,6 +12331,132 @@ export interface Locale extends ILocale {
*/
"tearing": string;
};
"_fxProps": {
/**
*
*/
"angle": string;
/**
*
*/
"scale": string;
/**
*
*/
"size": string;
/**
*
*/
"color": string;
/**
*
*/
"opacity": string;
/**
*
*/
"normalize": string;
/**
*
*/
"amount": string;
/**
*
*/
"lightness": string;
/**
*
*/
"contrast": string;
/**
*
*/
"hue": string;
/**
*
*/
"brightness": string;
/**
*
*/
"saturation": string;
/**
*
*/
"max": string;
/**
*
*/
"min": string;
/**
*
*/
"direction": string;
/**
*
*/
"phase": string;
/**
*
*/
"frequency": string;
/**
*
*/
"strength": string;
/**
*
*/
"glitchChannelShift": string;
/**
*
*/
"seed": string;
/**
*
*/
"redComponent": string;
/**
*
*/
"greenComponent": string;
/**
*
*/
"blueComponent": string;
/**
*
*/
"threshold": string;
/**
* X
*/
"centerX": string;
/**
* Y
*/
"centerY": string;
/**
*
*/
"zoomLinesSmoothing": string;
/**
*
*/
"zoomLinesSmoothingDescription": string;
/**
*
*/
"zoomLinesThreshold": string;
/**
*
*/
"zoomLinesMaskSize": string;
/**
*
*/
"zoomLinesBlack": string;
};
};
/**
*

View File

@ -3267,10 +3267,10 @@ _watermarkEditor:
type: "タイプ"
image: "画像"
advanced: "高度"
angle: "角度"
stripe: "ストライプ"
stripeWidth: "ラインの幅"
stripeFrequency: "ラインの数"
angle: "角度"
polkadot: "ポルカドット"
checker: "チェッカー"
polkadotMainDotOpacity: "メインドットの不透明度"
@ -3283,6 +3283,7 @@ _imageEffector:
title: "エフェクト"
addEffect: "エフェクトを追加"
discardChangesConfirm: "変更を破棄して終了しますか?"
nothingToConfigure: "設定項目はありません"
_fxs:
chromaticAberration: "色収差"
@ -3302,6 +3303,39 @@ _imageEffector:
blockNoise: "ブロックノイズ"
tearing: "ティアリング"
_fxProps:
angle: "角度"
scale: "サイズ"
size: "サイズ"
color: "色"
opacity: "不透明度"
normalize: "正規化"
amount: "量"
lightness: "明るさ"
contrast: "コントラスト"
hue: "色相"
brightness: "輝度"
saturation: "彩度"
max: "最大値"
min: "最小値"
direction: "方向"
phase: "位相"
frequency: "頻度"
strength: "強さ"
glitchChannelShift: "ズレ"
seed: "シード値"
redComponent: "赤色成分"
greenComponent: "緑色成分"
blueComponent: "青色成分"
threshold: "しきい値"
centerX: "中心X"
centerY: "中心Y"
zoomLinesSmoothing: "スムージング"
zoomLinesSmoothingDescription: "スムージングと集中線の幅の設定は併用できません。"
zoomLinesThreshold: "集中線の幅"
zoomLinesMaskSize: "中心径"
zoomLinesBlack: "黒色にする"
drafts: "下書き"
_drafts:
select: "下書きを選択"

View File

@ -1,12 +1,12 @@
{
"name": "misskey",
"version": "2025.8.0-alpha.6",
"version": "2025.8.0-alpha.7",
"codename": "nasubi",
"repository": {
"type": "git",
"url": "https://github.com/misskey-dev/misskey.git"
},
"packageManager": "pnpm@10.13.1",
"packageManager": "pnpm@10.14.0",
"workspaces": [
"packages/frontend-shared",
"packages/frontend",
@ -53,7 +53,7 @@
},
"dependencies": {
"cssnano": "7.1.0",
"esbuild": "0.25.6",
"esbuild": "0.25.8",
"execa": "9.6.0",
"fast-glob": "3.3.3",
"glob": "11.0.3",
@ -62,20 +62,20 @@
"postcss": "8.5.6",
"tar": "7.4.3",
"terser": "5.43.1",
"typescript": "5.8.3"
"typescript": "5.9.2"
},
"devDependencies": {
"@misskey-dev/eslint-plugin": "2.1.0",
"@types/node": "22.16.4",
"@typescript-eslint/eslint-plugin": "8.37.0",
"@typescript-eslint/parser": "8.37.0",
"@types/node": "22.17.1",
"@typescript-eslint/eslint-plugin": "8.39.0",
"@typescript-eslint/parser": "8.39.0",
"cross-env": "7.0.3",
"cypress": "14.5.2",
"eslint": "9.31.0",
"cypress": "14.5.4",
"eslint": "9.33.0",
"globals": "16.3.0",
"ncp": "2.0.0",
"pnpm": "10.13.1",
"start-server-and-test": "2.0.12"
"pnpm": "10.14.0",
"start-server-and-test": "2.0.13"
},
"optionalDependencies": {
"@tensorflow/tfjs-core": "4.22.0"

View File

@ -32,6 +32,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
private chatService: ChatService,
) {
super(meta, paramDef, async (ps, me) => {
await this.chatService.checkChatAvailability(me.id, 'read');
await this.chatService.readAllChatMessages(me.id);
});
}

View File

@ -10,6 +10,7 @@ import { QueryService } from '@/core/QueryService.js';
import { DI } from '@/di-symbols.js';
import { RoleService } from '@/core/RoleService.js';
import { ChatEntityService } from '@/core/entities/ChatEntityService.js';
import { ChatService } from '@/core/ChatService.js';
import { ApiError } from '../../../error.js';
export const meta = {
@ -60,14 +61,21 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
@Inject(DI.chatMessagesRepository)
private chatMessagesRepository: ChatMessagesRepository,
private chatService: ChatService,
private chatEntityService: ChatEntityService,
private queryService: QueryService,
private roleService: RoleService,
) {
super(meta, paramDef, async (ps, me) => {
const isModerator = await this.roleService.isModerator(me);
if (!isModerator) {
await this.chatService.checkChatAvailability(me.id, 'read');
}
const file = await this.driveFilesRepository.findOneBy({
id: ps.fileId,
userId: await this.roleService.isModerator(me) ? undefined : me.id,
userId: isModerator ? undefined : me.id,
});
if (file == null) {

View File

@ -69,8 +69,10 @@ export class LocaleInliner {
async saveAllLocales(locales: Record<string, Locale>) {
const localeNames = Object.keys(locales);
for (const localeName of localeNames) {
this.logger.info(`Creating bundle for ${localeName}`);
await this.saveLocale(localeName, locales[localeName]);
}
this.logger.info('Done');
}
async saveLocale(localeName: string, localeJson: Locale) {

View File

@ -14,73 +14,15 @@ SPDX-License-Identifier: AGPL-3.0-only
</div>
</template>
<div :class="$style.root" class="_gaps">
<div v-for="[k, v] in Object.entries(fx.params)" :key="k">
<MkSwitch
v-if="v.type === 'boolean'"
v-model="layer.params[k]"
>
<template #label>{{ fx.params[k].label ?? k }}</template>
</MkSwitch>
<MkRange
v-else-if="v.type === 'number'"
v-model="layer.params[k]"
continuousUpdate
:min="v.min"
:max="v.max"
:step="v.step"
:textConverter="fx.params[k].toViewValue"
@thumbDoubleClicked="() => {
if (fx.params[k].default != null) {
layer.params[k] = fx.params[k].default;
} else {
layer.params[k] = v.min;
}
}"
>
<template #label>{{ fx.params[k].label ?? k }}</template>
</MkRange>
<MkRadios
v-else-if="v.type === 'number:enum'"
v-model="layer.params[k]"
>
<template #label>{{ fx.params[k].label ?? k }}</template>
<option v-for="item in v.enum" :value="item.value">{{ item.label }}</option>
</MkRadios>
<div v-else-if="v.type === 'seed'">
<MkRange
v-model="layer.params[k]"
continuousUpdate
type="number"
:min="0"
:max="10000"
:step="1"
>
<template #label>{{ fx.params[k].label ?? k }}</template>
</MkRange>
</div>
<MkInput
v-else-if="v.type === 'color'"
:modelValue="getHex(layer.params[k])"
type="color"
@update:modelValue="v => { const c = getRgb(v); if (c != null) layer.params[k] = c; }"
>
<template #label>{{ fx.params[k].label ?? k }}</template>
</MkInput>
</div>
</div>
<MkImageEffectorFxForm v-model="layer.params" :paramDefs="fx.params" />
</MkFolder>
</template>
<script setup lang="ts">
import type { ImageEffectorLayer } from '@/utility/image-effector/ImageEffector.js';
import { i18n } from '@/i18n.js';
import MkFolder from '@/components/MkFolder.vue';
import MkButton from '@/components/MkButton.vue';
import MkInput from '@/components/MkInput.vue';
import MkRadios from '@/components/MkRadios.vue';
import MkSwitch from '@/components/MkSwitch.vue';
import MkRange from '@/components/MkRange.vue';
import MkImageEffectorFxForm from '@/components/MkImageEffectorFxForm.vue';
import { FXS } from '@/utility/image-effector/fxs.js';
const layer = defineModel<ImageEffectorLayer>('layer', { required: true });
@ -94,28 +36,4 @@ const emit = defineEmits<{
(e: 'swapUp'): void;
(e: 'swapDown'): void;
}>();
function getHex(c: [number, number, number]) {
return `#${c.map(x => (x * 255).toString(16).padStart(2, '0')).join('')}`;
}
function getRgb(hex: string | number): [number, number, number] | null {
if (
typeof hex === 'number' ||
typeof hex !== 'string' ||
!/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(hex)
) {
return null;
}
const m = hex.slice(1).match(/[0-9a-fA-F]{2}/g);
if (m == null) return [0, 0, 0];
return m.map(x => parseInt(x, 16) / 255) as [number, number, number];
}
</script>
<style module>
.root {
}
</style>

View File

@ -0,0 +1,95 @@
<!--
SPDX-FileCopyrightText: syuilo and misskey-project
SPDX-License-Identifier: AGPL-3.0-only
-->
<template>
<div class="_gaps">
<div v-for="v, k in paramDefs" :key="k">
<MkSwitch
v-if="v.type === 'boolean'"
v-model="params[k]">
<template #label>{{ v.label ?? k }}</template>
<template v-if="v.caption != null" #caption>{{ v.caption }}</template>
</MkSwitch>
<MkRange
v-else-if="v.type === 'number'"
v-model="params[k]"
continuousUpdate
:min="v.min"
:max="v.max"
:step="v.step"
:textConverter="v.toViewValue"
@thumbDoubleClicked="() => {
params[k] = v.default;
}"
>
<template #label>{{ v.label ?? k }}</template>
<template v-if="v.caption != null" #caption>{{ v.caption }}</template>
</MkRange>
<MkRadios v-else-if="v.type === 'number:enum'" v-model="params[k]">
<template #label>{{ v.label ?? k }}</template>
<template v-if="v.caption != null" #caption>{{ v.caption }}</template>
<option v-for="item in v.enum" :value="item.value">
<i v-if="item.icon" :class="item.icon"></i>
<template v-else>{{ item.label }}</template>
</option>
</MkRadios>
<div v-else-if="v.type === 'seed'">
<MkRange v-model="params[k]" continuousUpdate type="number" :min="0" :max="10000" :step="1">
<template #label>{{ v.label ?? k }}</template>
<template v-if="v.caption != null" #caption>{{ v.caption }}</template>
</MkRange>
</div>
<MkInput v-else-if="v.type === 'color'" :modelValue="getHex(params[k])" type="color" @update:modelValue="v => { const c = getRgb(v); if (c != null) params[k] = c; }">
<template #label>{{ v.label ?? k }}</template>
<template v-if="v.caption != null" #caption>{{ v.caption }}</template>
</MkInput>
</div>
<div v-if="Object.keys(paramDefs).length === 0" :class="$style.nothingToConfigure">
{{ i18n.ts._imageEffector.nothingToConfigure }}
</div>
</div>
</template>
<script setup lang="ts">
import MkInput from '@/components/MkInput.vue';
import MkRadios from '@/components/MkRadios.vue';
import MkSwitch from '@/components/MkSwitch.vue';
import MkRange from '@/components/MkRange.vue';
import { i18n } from '@/i18n.js';
import type { ImageEffectorRGB, ImageEffectorFxParamDefs } from '@/utility/image-effector/ImageEffector.js';
defineProps<{
paramDefs: ImageEffectorFxParamDefs;
}>();
const params = defineModel<Record<string, any>>({ required: true });
function getHex(c: ImageEffectorRGB) {
return `#${c.map(x => (x * 255).toString(16).padStart(2, '0')).join('')}`;
}
function getRgb(hex: string | number): ImageEffectorRGB | null {
if (
typeof hex === 'number' ||
typeof hex !== 'string' ||
!/^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/.test(hex)
) {
return null;
}
const m = hex.slice(1).match(/[0-9a-fA-F]{2}/g);
if (m == null) return [0, 0, 0];
return m.map(x => parseInt(x, 16) / 255) as ImageEffectorRGB;
}
</script>
<style module>
.nothingToConfigure {
opacity: 0.7;
text-align: center;
font-size: 14px;
padding: 0 10px;
}
</style>

View File

@ -44,6 +44,11 @@ const y = defineModel<string>('y', { default: 'center' });
height: 32px;
background: var(--MI_THEME-panel);
border-radius: 4px;
transition: background 0.1s ease;
&:not(.active):hover {
background: var(--MI_THEME-buttonHoverBg);
}
&.active {
background: var(--MI_THEME-accentedBg);

View File

@ -62,6 +62,8 @@ export type Column = {
withSensitive?: boolean;
onlyFiles?: boolean;
soundSetting?: SoundStore;
// The cache for the name of the antenna, channel, list, or role
timelineNameCache?: string;
};
const _currentProfile = prefer.s['deck.profiles'].find(p => p.name === prefer.s['deck.profile']);

View File

@ -112,7 +112,7 @@ const favorited = ref(false);
const searchQuery = ref('');
const searchPaginator = shallowRef();
const searchKey = ref('');
const featuredPaginator = markRaw(new Paginator('channels/featured', {
const featuredPaginator = markRaw(new Paginator('notes/featured', {
limit: 10,
computedParams: computed(() => ({
channelId: props.channelId,

View File

@ -128,9 +128,11 @@ SPDX-License-Identifier: AGPL-3.0-only
<hr>
<MkButton @click="readAllChatMessages">Read all chat messages</MkButton>
<template v-if="$i.policies.chatAvailability !== 'unavailable'">
<MkButton @click="readAllChatMessages">Read all chat messages</MkButton>
<hr>
<hr>
</template>
<FormSlot>
<MkButton danger @click="migrate"><i class="ti ti-refresh"></i> {{ i18n.ts.migrateOldSettings }}</MkButton>

View File

@ -3,14 +3,13 @@
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { ref, defineAsyncComponent } from 'vue';
import { Interpreter, Parser, utils, values } from '@syuilo/aiscript';
import { ref } from 'vue';
import { compareVersions } from 'compare-versions';
import { isSafeMode } from '@@/js/config.js';
import * as Misskey from 'misskey-js';
import type { Parser, Interpreter, values } from '@syuilo/aiscript';
import type { FormWithDefault } from '@/utility/form.js';
import { genId } from '@/utility/id.js';
import { aiScriptReadline, createAiScriptEnv } from '@/aiscript/api.js';
import { store } from '@/store.js';
import * as os from '@/os.js';
import { misskeyApi } from '@/utility/misskey-api.js';
@ -39,7 +38,13 @@ export type AiScriptPluginMeta = {
config?: Record<string, any>;
};
const parser = new Parser();
let _parser: Parser | null = null;
async function getParser(): Promise<Parser> {
const { Parser } = await import('@syuilo/aiscript');
_parser ??= new Parser();
return _parser;
}
export function isSupportedAiScriptVersion(version: string): boolean {
try {
@ -54,6 +59,8 @@ export async function parsePluginMeta(code: string): Promise<AiScriptPluginMeta>
throw new Error('code is required');
}
const { Interpreter, utils } = await import('@syuilo/aiscript');
const lv = utils.getLangVersion(code);
if (lv == null) {
throw new Error('No language version annotation found');
@ -63,6 +70,7 @@ export async function parsePluginMeta(code: string): Promise<AiScriptPluginMeta>
let ast;
try {
const parser = await getParser();
ast = parser.parse(code);
} catch (err) {
throw new Error('Aiscript syntax error');
@ -255,7 +263,10 @@ async function launchPlugin(id: Plugin['installId']): Promise<void> {
await authorizePlugin(plugin);
const aiscript = new Interpreter(createPluginEnv({
const { Interpreter, utils } = await import('@syuilo/aiscript');
const { aiScriptReadline } = await import('@/aiscript/api.js');
const aiscript = new Interpreter(await createPluginEnv({
plugin: plugin,
storageKey: 'plugins:' + plugin.installId,
}), {
@ -280,6 +291,7 @@ async function launchPlugin(id: Plugin['installId']): Promise<void> {
pluginContexts.set(plugin.installId, aiscript);
const parser = await getParser();
aiscript.exec(parser.parse(plugin.src)).then(
() => {
console.info('Plugin installed:', plugin.name, 'v' + plugin.version);
@ -336,9 +348,12 @@ export function changePluginActive(plugin: Plugin, active: boolean) {
}
}
function createPluginEnv(opts: { plugin: Plugin; storageKey: string }): Record<string, values.Value> {
async function createPluginEnv(opts: { plugin: Plugin; storageKey: string }): Promise<Record<string, values.Value>> {
const id = opts.plugin.installId;
const { utils, values } = await import('@syuilo/aiscript');
const { createAiScriptEnv } = await import('@/aiscript/api.js');
const config = new Map<string, values.Value>();
for (const [k, v] of Object.entries(opts.plugin.config ?? {})) {
config.set(k, utils.jsToVal(typeof opts.plugin.configData[k] !== 'undefined' ? opts.plugin.configData[k] : v.default));

View File

@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<template>
<XColumn :menu="menu" :column="column" :isStacked="isStacked" :refresher="async () => { await timeline?.reloadTimeline() }">
<template #header>
<i class="ti ti-antenna"></i><span style="margin-left: 8px;">{{ column.name || antennaName || i18n.ts._deck._columns.antenna }}</span>
<i class="ti ti-antenna"></i><span style="margin-left: 8px;">{{ column.name || column.timelineNameCache || i18n.ts._deck._columns.antenna }}</span>
</template>
<MkStreamingNotesTimeline v-if="column.antennaId" ref="timeline" src="antenna" :antenna="column.antennaId"/>
@ -35,18 +35,13 @@ const props = defineProps<{
const timeline = useTemplateRef('timeline');
const soundSetting = ref<SoundStore>(props.column.soundSetting ?? { type: null, volume: 1 });
const antennaName = ref<string | null>(null);
onMounted(() => {
if (props.column.antennaId == null) {
setAntenna();
}
});
watch([() => props.column.name, () => props.column.antennaId], () => {
if (!props.column.name && props.column.antennaId) {
} else if (props.column.timelineNameCache == null) {
misskeyApi('antennas/show', { antennaId: props.column.antennaId })
.then(value => antennaName.value = value.name);
.then(value => updateColumn(props.column.id, { timelineNameCache: value.name }));
}
});
@ -77,6 +72,7 @@ async function setAntenna() {
antennasCache.delete();
updateColumn(props.column.id, {
antennaId: newAntenna.id,
timelineNameCache: newAntenna.name,
});
},
closed: () => {
@ -88,6 +84,7 @@ async function setAntenna() {
updateColumn(props.column.id, {
antennaId: antenna.id,
timelineNameCache: antenna.name,
});
}

View File

@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<template>
<XColumn :menu="menu" :column="column" :isStacked="isStacked" :refresher="async () => { await timeline?.reloadTimeline() }">
<template #header>
<i class="ti ti-device-tv"></i><span style="margin-left: 8px;">{{ column.name || channel?.name || i18n.ts._deck._columns.channel }}</span>
<i class="ti ti-device-tv"></i><span style="margin-left: 8px;">{{ column.name || column.timelineNameCache || i18n.ts._deck._columns.channel }}</span>
</template>
<template v-if="column.channelId">
@ -46,13 +46,9 @@ const soundSetting = ref<SoundStore>(props.column.soundSetting ?? { type: null,
onMounted(() => {
if (props.column.channelId == null) {
setChannel();
}
});
watch([() => props.column.name, () => props.column.channelId], () => {
if (!props.column.name && props.column.channelId) {
} else if (!props.column.name && props.column.channelId) {
misskeyApi('channels/show', { channelId: props.column.channelId })
.then(value => channel.value = value);
.then(value => updateColumn(props.column.id, { timelineNameCache: value.name }));
}
});
@ -72,7 +68,7 @@ async function setChannel() {
if (canceled || chosenChannel == null) return;
updateColumn(props.column.id, {
channelId: chosenChannel.id,
name: chosenChannel.name,
timelineNameCache: chosenChannel.name,
});
}

View File

@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<template>
<XColumn :menu="menu" :column="column" :isStacked="isStacked" :refresher="async () => { await timeline?.reloadTimeline() }">
<template #header>
<i class="ti ti-list"></i><span style="margin-left: 8px;">{{ (column.name || listName) ?? i18n.ts._deck._columns.list }}</span>
<i class="ti ti-list"></i><span style="margin-left: 8px;">{{ column.name || column.timelineNameCache || i18n.ts._deck._columns.list }}</span>
</template>
<MkStreamingNotesTimeline v-if="column.listId" ref="timeline" src="list" :list="column.listId" :withRenotes="withRenotes"/>
@ -36,18 +36,13 @@ const props = defineProps<{
const timeline = useTemplateRef('timeline');
const withRenotes = ref(props.column.withRenotes ?? true);
const soundSetting = ref<SoundStore>(props.column.soundSetting ?? { type: null, volume: 1 });
const listName = ref<string | null>(null);
onMounted(() => {
if (props.column.listId == null) {
setList();
}
});
watch([() => props.column.name, () => props.column.listId], () => {
if (!props.column.name && props.column.listId) {
} else if (props.column.timelineNameCache == null) {
misskeyApi('users/lists/show', { listId: props.column.listId })
.then(value => listName.value = value.name);
.then(value => updateColumn(props.column.id, { timelineNameCache: value.name }));
}
});
@ -89,10 +84,12 @@ async function setList() {
updateColumn(props.column.id, {
listId: res.id,
timelineNameCache: res.name,
});
} else {
updateColumn(props.column.id, {
listId: list.id,
timelineNameCache: list.name,
});
}
}

View File

@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<template>
<XColumn :menu="menu" :column="column" :isStacked="isStacked" :refresher="async () => { await timeline?.reloadTimeline() }">
<template #header>
<i class="ti ti-badge"></i><span style="margin-left: 8px;">{{ column.name || roleName || i18n.ts._deck._columns.roleTimeline }}</span>
<i class="ti ti-badge"></i><span style="margin-left: 8px;">{{ column.name || column.timelineNameCache || i18n.ts._deck._columns.roleTimeline }}</span>
</template>
<MkStreamingNotesTimeline v-if="column.roleId" ref="timeline" src="role" :role="column.roleId"/>
@ -33,18 +33,13 @@ const props = defineProps<{
const timeline = useTemplateRef('timeline');
const soundSetting = ref<SoundStore>(props.column.soundSetting ?? { type: null, volume: 1 });
const roleName = ref<string | null>(null);
onMounted(() => {
if (props.column.roleId == null) {
setRole();
}
});
watch([() => props.column.name, () => props.column.roleId], () => {
if (!props.column.name && props.column.roleId) {
} else if (props.column.timelineNameCache == null) {
misskeyApi('roles/show', { roleId: props.column.roleId })
.then(value => roleName.value = value.name);
.then(value => updateColumn(props.column.id, { timelineNameCache: value.name }));
}
});
@ -64,6 +59,7 @@ async function setRole() {
if (canceled || role == null) return;
updateColumn(props.column.id, {
roleId: role.id,
timelineNameCache: role.name,
});
}

View File

@ -6,22 +6,78 @@
import { getProxiedImageUrl } from '../media-proxy.js';
import { initShaderProgram } from '../webgl.js';
export type ImageEffectorRGB = [r: number, g: number, b: number];
type ParamTypeToPrimitive = {
'number': number;
'number:enum': number;
'boolean': boolean;
'align': { x: 'left' | 'center' | 'right'; y: 'top' | 'center' | 'bottom'; };
'seed': number;
'texture': { type: 'text'; text: string | null; } | { type: 'url'; url: string | null; } | null;
'color': [r: number, g: number, b: number];
[K in ImageEffectorFxParamDef['type']]: (ImageEffectorFxParamDef & { type: K })['default'];
};
type ImageEffectorFxParamDefs = Record<string, {
type: keyof ParamTypeToPrimitive;
default: any;
interface CommonParamDef {
type: string;
label?: string;
toViewValue?: (v: any) => string;
}>;
caption?: string;
default: any;
}
interface NumberParamDef extends CommonParamDef {
type: 'number';
default: number;
min: number;
max: number;
step?: number;
toViewValue?: (v: number) => string;
};
interface NumberEnumParamDef extends CommonParamDef {
type: 'number:enum';
enum: {
value: number;
label?: string;
icon?: string;
}[];
default: number;
};
interface BooleanParamDef extends CommonParamDef {
type: 'boolean';
default: boolean;
};
interface AlignParamDef extends CommonParamDef {
type: 'align';
default: {
x: 'left' | 'center' | 'right';
y: 'top' | 'center' | 'bottom';
};
};
interface SeedParamDef extends CommonParamDef {
type: 'seed';
default: number;
};
interface TextureParamDef extends CommonParamDef {
type: 'texture';
default: { type: 'text'; text: string | null; } | { type: 'url'; url: string | null; } | null;
};
interface ColorParamDef extends CommonParamDef {
type: 'color';
default: ImageEffectorRGB;
};
type ImageEffectorFxParamDef = NumberParamDef | NumberEnumParamDef | BooleanParamDef | AlignParamDef | SeedParamDef | TextureParamDef | ColorParamDef;
export type ImageEffectorFxParamDefs = Record<string, ImageEffectorFxParamDef>;
export type GetParamType<T extends ImageEffectorFxParamDef> =
T extends NumberEnumParamDef
? T['enum'][number]['value']
: ParamTypeToPrimitive[T['type']];
export type ParamsRecordTypeToDefRecord<PS extends ImageEffectorFxParamDefs> = {
[K in keyof PS]: GetParamType<PS[K]>;
};
export function defineImageEffectorFx<ID extends string, PS extends ImageEffectorFxParamDefs, US extends string[]>(fx: ImageEffectorFx<ID, PS, US>) {
return fx;
@ -36,9 +92,7 @@ export type ImageEffectorFx<ID extends string = string, PS extends ImageEffector
main: (ctx: {
gl: WebGL2RenderingContext;
program: WebGLProgram;
params: {
[key in keyof PS]: ParamTypeToPrimitive[PS[key]['type']];
};
params: ParamsRecordTypeToDefRecord<PS>;
u: Record<US[number], WebGLUniformLocation>;
width: number;
height: number;

View File

@ -48,20 +48,22 @@ void main() {
`;
export const FX_blockNoise = defineImageEffectorFx({
id: 'blockNoise' as const,
id: 'blockNoise',
name: i18n.ts._imageEffector._fxs.glitch + ': ' + i18n.ts._imageEffector._fxs.blockNoise,
shader,
uniforms: ['amount', 'channelShift'] as const,
params: {
amount: {
type: 'number' as const,
label: i18n.ts._imageEffector._fxProps.amount,
type: 'number',
default: 50,
min: 1,
max: 100,
step: 1,
},
strength: {
type: 'number' as const,
label: i18n.ts._imageEffector._fxProps.strength,
type: 'number',
default: 0.05,
min: -1,
max: 1,
@ -69,7 +71,8 @@ export const FX_blockNoise = defineImageEffectorFx({
toViewValue: v => Math.round(v * 100) + '%',
},
width: {
type: 'number' as const,
label: i18n.ts.width,
type: 'number',
default: 0.05,
min: 0.01,
max: 1,
@ -77,7 +80,8 @@ export const FX_blockNoise = defineImageEffectorFx({
toViewValue: v => Math.round(v * 100) + '%',
},
height: {
type: 'number' as const,
label: i18n.ts.height,
type: 'number',
default: 0.01,
min: 0.01,
max: 1,
@ -85,7 +89,8 @@ export const FX_blockNoise = defineImageEffectorFx({
toViewValue: v => Math.round(v * 100) + '%',
},
channelShift: {
type: 'number' as const,
label: i18n.ts._imageEffector._fxProps.glitchChannelShift,
type: 'number',
default: 0,
min: 0,
max: 10,
@ -93,7 +98,8 @@ export const FX_blockNoise = defineImageEffectorFx({
toViewValue: v => Math.round(v * 100) + '%',
},
seed: {
type: 'seed' as const,
label: i18n.ts._imageEffector._fxProps.seed,
type: 'seed',
default: 100,
},
},

View File

@ -47,13 +47,14 @@ void main() {
`;
export const FX_checker = defineImageEffectorFx({
id: 'checker' as const,
id: 'checker',
name: i18n.ts._imageEffector._fxs.checker,
shader,
uniforms: ['angle', 'scale', 'color', 'opacity'] as const,
params: {
angle: {
type: 'number' as const,
label: i18n.ts._imageEffector._fxProps.angle,
type: 'number',
default: 0,
min: -1.0,
max: 1.0,
@ -61,18 +62,21 @@ export const FX_checker = defineImageEffectorFx({
toViewValue: v => Math.round(v * 90) + '°',
},
scale: {
type: 'number' as const,
label: i18n.ts._imageEffector._fxProps.scale,
type: 'number',
default: 3.0,
min: 1.0,
max: 10.0,
step: 0.1,
},
color: {
type: 'color' as const,
label: i18n.ts._imageEffector._fxProps.color,
type: 'color',
default: [1, 1, 1],
},
opacity: {
type: 'number' as const,
label: i18n.ts._imageEffector._fxProps.opacity,
type: 'number',
default: 0.5,
min: 0.0,
max: 1.0,

View File

@ -52,17 +52,19 @@ void main() {
`;
export const FX_chromaticAberration = defineImageEffectorFx({
id: 'chromaticAberration' as const,
id: 'chromaticAberration',
name: i18n.ts._imageEffector._fxs.chromaticAberration,
shader,
uniforms: ['amount', 'start', 'normalize'] as const,
params: {
normalize: {
type: 'boolean' as const,
label: i18n.ts._imageEffector._fxProps.normalize,
type: 'boolean',
default: false,
},
amount: {
type: 'number' as const,
label: i18n.ts._imageEffector._fxProps.amount,
type: 'number',
default: 0.1,
min: 0.0,
max: 1.0,

View File

@ -85,13 +85,14 @@ void main() {
`;
export const FX_colorAdjust = defineImageEffectorFx({
id: 'colorAdjust' as const,
id: 'colorAdjust',
name: i18n.ts._imageEffector._fxs.colorAdjust,
shader,
uniforms: ['lightness', 'contrast', 'hue', 'brightness', 'saturation'] as const,
params: {
lightness: {
type: 'number' as const,
label: i18n.ts._imageEffector._fxProps.lightness,
type: 'number',
default: 0,
min: -1,
max: 1,
@ -99,7 +100,8 @@ export const FX_colorAdjust = defineImageEffectorFx({
toViewValue: v => Math.round(v * 100) + '%',
},
contrast: {
type: 'number' as const,
label: i18n.ts._imageEffector._fxProps.contrast,
type: 'number',
default: 1,
min: 0,
max: 4,
@ -107,7 +109,8 @@ export const FX_colorAdjust = defineImageEffectorFx({
toViewValue: v => Math.round(v * 100) + '%',
},
hue: {
type: 'number' as const,
label: i18n.ts._imageEffector._fxProps.hue,
type: 'number',
default: 0,
min: -1,
max: 1,
@ -115,7 +118,8 @@ export const FX_colorAdjust = defineImageEffectorFx({
toViewValue: v => Math.round(v * 180) + '°',
},
brightness: {
type: 'number' as const,
label: i18n.ts._imageEffector._fxProps.brightness,
type: 'number',
default: 1,
min: 0,
max: 4,
@ -123,7 +127,8 @@ export const FX_colorAdjust = defineImageEffectorFx({
toViewValue: v => Math.round(v * 100) + '%',
},
saturation: {
type: 'number' as const,
label: i18n.ts._imageEffector._fxProps.saturation,
type: 'number',
default: 1,
min: 0,
max: 4,

View File

@ -26,13 +26,14 @@ void main() {
`;
export const FX_colorClamp = defineImageEffectorFx({
id: 'colorClamp' as const,
id: 'colorClamp',
name: i18n.ts._imageEffector._fxs.colorClamp,
shader,
uniforms: ['max', 'min'] as const,
params: {
max: {
type: 'number' as const,
label: i18n.ts._imageEffector._fxProps.max,
type: 'number',
default: 1.0,
min: 0.0,
max: 1.0,
@ -40,7 +41,8 @@ export const FX_colorClamp = defineImageEffectorFx({
toViewValue: v => Math.round(v * 100) + '%',
},
min: {
type: 'number' as const,
label: i18n.ts._imageEffector._fxProps.min,
type: 'number',
default: -1.0,
min: -1.0,
max: 0.0,

View File

@ -30,13 +30,14 @@ void main() {
`;
export const FX_colorClampAdvanced = defineImageEffectorFx({
id: 'colorClampAdvanced' as const,
id: 'colorClampAdvanced',
name: i18n.ts._imageEffector._fxs.colorClampAdvanced,
shader,
uniforms: ['rMax', 'rMin', 'gMax', 'gMin', 'bMax', 'bMin'] as const,
params: {
rMax: {
type: 'number' as const,
label: `${i18n.ts._imageEffector._fxProps.max} (${i18n.ts._imageEffector._fxProps.redComponent})`,
type: 'number',
default: 1.0,
min: 0.0,
max: 1.0,
@ -44,7 +45,8 @@ export const FX_colorClampAdvanced = defineImageEffectorFx({
toViewValue: v => Math.round(v * 100) + '%',
},
rMin: {
type: 'number' as const,
label: `${i18n.ts._imageEffector._fxProps.min} (${i18n.ts._imageEffector._fxProps.redComponent})`,
type: 'number',
default: -1.0,
min: -1.0,
max: 0.0,
@ -52,7 +54,8 @@ export const FX_colorClampAdvanced = defineImageEffectorFx({
toViewValue: v => Math.round(v * 100) + '%',
},
gMax: {
type: 'number' as const,
label: `${i18n.ts._imageEffector._fxProps.max} (${i18n.ts._imageEffector._fxProps.greenComponent})`,
type: 'number',
default: 1.0,
min: 0.0,
max: 1.0,
@ -60,7 +63,8 @@ export const FX_colorClampAdvanced = defineImageEffectorFx({
toViewValue: v => Math.round(v * 100) + '%',
},
gMin: {
type: 'number' as const,
label: `${i18n.ts._imageEffector._fxProps.min} (${i18n.ts._imageEffector._fxProps.greenComponent})`,
type: 'number',
default: -1.0,
min: -1.0,
max: 0.0,
@ -68,7 +72,8 @@ export const FX_colorClampAdvanced = defineImageEffectorFx({
toViewValue: v => Math.round(v * 100) + '%',
},
bMax: {
type: 'number' as const,
label: `${i18n.ts._imageEffector._fxProps.max} (${i18n.ts._imageEffector._fxProps.blueComponent})`,
type: 'number',
default: 1.0,
min: 0.0,
max: 1.0,
@ -76,7 +81,8 @@ export const FX_colorClampAdvanced = defineImageEffectorFx({
toViewValue: v => Math.round(v * 100) + '%',
},
bMin: {
type: 'number' as const,
label: `${i18n.ts._imageEffector._fxProps.min} (${i18n.ts._imageEffector._fxProps.blueComponent})`,
type: 'number',
default: -1.0,
min: -1.0,
max: 0.0,

View File

@ -34,18 +34,23 @@ void main() {
`;
export const FX_distort = defineImageEffectorFx({
id: 'distort' as const,
id: 'distort',
name: i18n.ts._imageEffector._fxs.distort,
shader,
uniforms: ['phase', 'frequency', 'strength', 'direction'] as const,
params: {
direction: {
type: 'number:enum' as const,
enum: [{ value: 0, label: 'v' }, { value: 1, label: 'h' }],
label: i18n.ts._imageEffector._fxProps.direction,
type: 'number:enum',
enum: [
{ value: 0 as const, label: i18n.ts.horizontal },
{ value: 1 as const, label: i18n.ts.vertical },
],
default: 1,
},
phase: {
type: 'number' as const,
label: i18n.ts._imageEffector._fxProps.phase,
type: 'number',
default: 0.0,
min: -1.0,
max: 1.0,
@ -53,14 +58,16 @@ export const FX_distort = defineImageEffectorFx({
toViewValue: v => Math.round(v * 100) + '%',
},
frequency: {
type: 'number' as const,
label: i18n.ts._imageEffector._fxProps.frequency,
type: 'number',
default: 30,
min: 0,
max: 100,
step: 0.1,
},
strength: {
type: 'number' as const,
label: i18n.ts._imageEffector._fxProps.strength,
type: 'number',
default: 0.05,
min: 0,
max: 1,

View File

@ -26,7 +26,7 @@ void main() {
`;
export const FX_grayscale = defineImageEffectorFx({
id: 'grayscale' as const,
id: 'grayscale',
name: i18n.ts._imageEffector._fxs.grayscale,
shader,
uniforms: [] as const,

View File

@ -27,21 +27,24 @@ void main() {
`;
export const FX_invert = defineImageEffectorFx({
id: 'invert' as const,
id: 'invert',
name: i18n.ts._imageEffector._fxs.invert,
shader,
uniforms: ['r', 'g', 'b'] as const,
params: {
r: {
type: 'boolean' as const,
label: i18n.ts._imageEffector._fxProps.redComponent,
type: 'boolean',
default: true,
},
g: {
type: 'boolean' as const,
label: i18n.ts._imageEffector._fxProps.greenComponent,
type: 'boolean',
default: true,
},
b: {
type: 'boolean' as const,
label: i18n.ts._imageEffector._fxProps.blueComponent,
type: 'boolean',
default: true,
},
},

View File

@ -35,19 +35,29 @@ void main() {
`;
export const FX_mirror = defineImageEffectorFx({
id: 'mirror' as const,
id: 'mirror',
name: i18n.ts._imageEffector._fxs.mirror,
shader,
uniforms: ['h', 'v'] as const,
params: {
h: {
type: 'number:enum' as const,
enum: [{ value: -1, label: '<-' }, { value: 0, label: '|' }, { value: 1, label: '->' }],
label: i18n.ts.horizontal,
type: 'number:enum',
enum: [
{ value: -1 as const, icon: 'ti ti-arrow-bar-right' },
{ value: 0 as const, icon: 'ti ti-minus-vertical' },
{ value: 1 as const, icon: 'ti ti-arrow-bar-left' }
],
default: -1,
},
v: {
type: 'number:enum' as const,
enum: [{ value: -1, label: '^' }, { value: 0, label: '-' }, { value: 1, label: 'v' }],
label: i18n.ts.vertical,
type: 'number:enum',
enum: [
{ value: -1 as const, icon: 'ti ti-arrow-bar-down' },
{ value: 0 as const, icon: 'ti ti-minus' },
{ value: 1 as const, icon: 'ti ti-arrow-bar-up' }
],
default: 0,
},
},

View File

@ -78,14 +78,16 @@ void main() {
}
`;
// Primarily used for watermark
export const FX_polkadot = defineImageEffectorFx({
id: 'polkadot' as const,
id: 'polkadot',
name: i18n.ts._imageEffector._fxs.polkadot,
shader,
uniforms: ['angle', 'scale', 'major_radius', 'major_opacity', 'minor_divisions', 'minor_radius', 'minor_opacity', 'color'] as const,
params: {
angle: {
type: 'number' as const,
label: i18n.ts._imageEffector._fxProps.angle,
type: 'number',
default: 0,
min: -1.0,
max: 1.0,
@ -93,21 +95,24 @@ export const FX_polkadot = defineImageEffectorFx({
toViewValue: v => Math.round(v * 90) + '°',
},
scale: {
type: 'number' as const,
label: i18n.ts._imageEffector._fxProps.scale,
type: 'number',
default: 3.0,
min: 1.0,
max: 10.0,
step: 0.1,
},
majorRadius: {
type: 'number' as const,
label: i18n.ts._watermarkEditor.polkadotMainDotRadius,
type: 'number',
default: 0.1,
min: 0.0,
max: 1.0,
step: 0.01,
},
majorOpacity: {
type: 'number' as const,
label: i18n.ts._watermarkEditor.polkadotMainDotOpacity,
type: 'number',
default: 0.75,
min: 0.0,
max: 1.0,
@ -115,21 +120,24 @@ export const FX_polkadot = defineImageEffectorFx({
toViewValue: v => Math.round(v * 100) + '%',
},
minorDivisions: {
type: 'number' as const,
label: i18n.ts._watermarkEditor.polkadotSubDotDivisions,
type: 'number',
default: 4,
min: 0,
max: 16,
step: 1,
},
minorRadius: {
type: 'number' as const,
label: i18n.ts._watermarkEditor.polkadotSubDotRadius,
type: 'number',
default: 0.25,
min: 0.0,
max: 1.0,
step: 0.01,
},
minorOpacity: {
type: 'number' as const,
label: i18n.ts._watermarkEditor.polkadotSubDotOpacity,
type: 'number',
default: 0.5,
min: 0.0,
max: 1.0,
@ -137,7 +145,8 @@ export const FX_polkadot = defineImageEffectorFx({
toViewValue: v => Math.round(v * 100) + '%',
},
color: {
type: 'color' as const,
label: i18n.ts._imageEffector._fxProps.color,
type: 'color',
default: [1, 1, 1],
},
},

View File

@ -48,14 +48,16 @@ void main() {
}
`;
// Primarily used for watermark
export const FX_stripe = defineImageEffectorFx({
id: 'stripe' as const,
id: 'stripe',
name: i18n.ts._imageEffector._fxs.stripe,
shader,
uniforms: ['angle', 'frequency', 'phase', 'threshold', 'color', 'opacity'] as const,
params: {
angle: {
type: 'number' as const,
label: i18n.ts._imageEffector._fxProps.angle,
type: 'number',
default: 0.5,
min: -1.0,
max: 1.0,
@ -63,14 +65,16 @@ export const FX_stripe = defineImageEffectorFx({
toViewValue: v => Math.round(v * 90) + '°',
},
frequency: {
type: 'number' as const,
label: i18n.ts._watermarkEditor.stripeFrequency,
type: 'number',
default: 10.0,
min: 1.0,
max: 30.0,
step: 0.1,
},
threshold: {
type: 'number' as const,
label: i18n.ts._watermarkEditor.stripeWidth,
type: 'number',
default: 0.1,
min: 0.0,
max: 1.0,
@ -78,11 +82,13 @@ export const FX_stripe = defineImageEffectorFx({
toViewValue: v => Math.round(v * 100) + '%',
},
color: {
type: 'color' as const,
label: i18n.ts._imageEffector._fxProps.color,
type: 'color',
default: [1, 1, 1],
},
opacity: {
type: 'number' as const,
label: i18n.ts._imageEffector._fxProps.opacity,
type: 'number',
default: 0.5,
min: 0.0,
max: 1.0,

View File

@ -38,20 +38,22 @@ void main() {
`;
export const FX_tearing = defineImageEffectorFx({
id: 'tearing' as const,
id: 'tearing',
name: i18n.ts._imageEffector._fxs.glitch + ': ' + i18n.ts._imageEffector._fxs.tearing,
shader,
uniforms: ['amount', 'channelShift'] as const,
params: {
amount: {
type: 'number' as const,
label: i18n.ts._imageEffector._fxProps.amount,
type: 'number',
default: 3,
min: 1,
max: 100,
step: 1,
},
strength: {
type: 'number' as const,
label: i18n.ts._imageEffector._fxProps.strength,
type: 'number',
default: 0.05,
min: -1,
max: 1,
@ -59,7 +61,8 @@ export const FX_tearing = defineImageEffectorFx({
toViewValue: v => Math.round(v * 100) + '%',
},
size: {
type: 'number' as const,
label: i18n.ts._imageEffector._fxProps.size,
type: 'number',
default: 0.2,
min: 0,
max: 1,
@ -67,7 +70,8 @@ export const FX_tearing = defineImageEffectorFx({
toViewValue: v => Math.round(v * 100) + '%',
},
channelShift: {
type: 'number' as const,
label: i18n.ts._imageEffector._fxProps.glitchChannelShift,
type: 'number',
default: 0.5,
min: 0,
max: 10,
@ -75,7 +79,8 @@ export const FX_tearing = defineImageEffectorFx({
toViewValue: v => Math.round(v * 100) + '%',
},
seed: {
type: 'seed' as const,
label: i18n.ts._imageEffector._fxProps.seed,
type: 'seed',
default: 100,
},
},

View File

@ -27,27 +27,30 @@ void main() {
`;
export const FX_threshold = defineImageEffectorFx({
id: 'threshold' as const,
id: 'threshold',
name: i18n.ts._imageEffector._fxs.threshold,
shader,
uniforms: ['r', 'g', 'b'] as const,
params: {
r: {
type: 'number' as const,
label: i18n.ts._imageEffector._fxProps.redComponent,
type: 'number',
default: 0.5,
min: 0.0,
max: 1.0,
step: 0.01,
},
g: {
type: 'number' as const,
label: i18n.ts._imageEffector._fxProps.greenComponent,
type: 'number',
default: 0.5,
min: 0.0,
max: 1.0,
step: 0.01,
},
b: {
type: 'number' as const,
label: i18n.ts._imageEffector._fxProps.blueComponent,
type: 'number',
default: 0.5,
min: 0.0,
max: 1.0,

View File

@ -83,46 +83,46 @@ void main() {
`;
export const FX_watermarkPlacement = defineImageEffectorFx({
id: 'watermarkPlacement' as const,
id: 'watermarkPlacement',
name: '(internal)',
shader,
uniforms: ['texture_watermark', 'resolution_watermark', 'scale', 'angle', 'opacity', 'repeat', 'alignX', 'alignY', 'fitMode'] as const,
params: {
cover: {
type: 'boolean' as const,
type: 'boolean',
default: false,
},
repeat: {
type: 'boolean' as const,
type: 'boolean',
default: false,
},
scale: {
type: 'number' as const,
type: 'number',
default: 0.3,
min: 0.0,
max: 1.0,
step: 0.01,
},
angle: {
type: 'number' as const,
type: 'number',
default: 0,
min: -1.0,
max: 1.0,
step: 0.01,
},
align: {
type: 'align' as const,
type: 'align',
default: { x: 'right', y: 'bottom' },
},
opacity: {
type: 'number' as const,
type: 'number',
default: 0.75,
min: 0.0,
max: 1.0,
step: 0.01,
},
watermark: {
type: 'texture' as const,
type: 'texture',
default: null,
},
},

View File

@ -37,59 +37,68 @@ void main() {
`;
export const FX_zoomLines = defineImageEffectorFx({
id: 'zoomLines' as const,
id: 'zoomLines',
name: i18n.ts._imageEffector._fxs.zoomLines,
shader,
uniforms: ['pos', 'frequency', 'thresholdEnabled', 'threshold', 'maskSize', 'black'] as const,
params: {
x: {
type: 'number' as const,
label: i18n.ts._imageEffector._fxProps.centerX,
type: 'number',
default: 0.0,
min: -1.0,
max: 1.0,
step: 0.01,
},
y: {
type: 'number' as const,
label: i18n.ts._imageEffector._fxProps.centerY,
type: 'number',
default: 0.0,
min: -1.0,
max: 1.0,
step: 0.01,
},
frequency: {
type: 'number' as const,
label: i18n.ts._imageEffector._fxProps.frequency,
type: 'number',
default: 30.0,
min: 1.0,
max: 200.0,
step: 0.1,
},
thresholdEnabled: {
type: 'boolean' as const,
default: true,
smoothing: {
label: i18n.ts._imageEffector._fxProps.zoomLinesSmoothing,
caption: i18n.ts._imageEffector._fxProps.zoomLinesSmoothingDescription,
type: 'boolean',
default: false,
},
threshold: {
type: 'number' as const,
label: i18n.ts._imageEffector._fxProps.zoomLinesThreshold,
type: 'number',
default: 0.2,
min: 0.0,
max: 1.0,
step: 0.01,
},
maskSize: {
type: 'number' as const,
label: i18n.ts._imageEffector._fxProps.zoomLinesMaskSize,
type: 'number',
default: 0.5,
min: 0.0,
max: 1.0,
step: 0.01,
},
black: {
type: 'boolean' as const,
label: i18n.ts._imageEffector._fxProps.zoomLinesBlack,
type: 'boolean',
default: false,
},
},
main: ({ gl, u, params }) => {
gl.uniform2f(u.pos, (1.0 + params.x) / 2.0, (1.0 + params.y) / 2.0);
gl.uniform1f(u.frequency, params.frequency);
gl.uniform1i(u.thresholdEnabled, params.thresholdEnabled ? 1 : 0);
// thresholdの調整が有効な間はsmoothingが利用できない
gl.uniform1i(u.thresholdEnabled, params.smoothing ? 0 : 1);
gl.uniform1f(u.threshold, params.threshold);
gl.uniform1f(u.maskSize, params.maskSize);
gl.uniform1i(u.black, params.black ? 1 : 0);

View File

@ -150,7 +150,6 @@ export class WatermarkRenderer {
minorRadius: layer.minorRadius,
minorOpacity: layer.minorOpacity,
color: layer.color,
opacity: layer.opacity,
},
};
} else if (layer.type === 'checker') {

View File

@ -37,6 +37,17 @@ let $iMock = vi.hoisted<Partial<typeof import('@/i.js').$i> | null >(
() => null
);
function errorWithPos<T extends errors.AiScriptError>(
error: T,
line: number,
column: number,
): T {
const pos = { line, column };
error.pos = pos;
error.message = error.message + `\n at <root> (Line ${pos.line}, Column ${pos.column})`;
return error;
}
vi.mock('@/i.js', () => {
return {
get $i() {
@ -316,7 +327,7 @@ describe('AiScript common API', () => {
await expect(() => exe(`
Mk:api('https://example.com/api/ping', {})
`)).rejects.toStrictEqual(
new errors.AiScriptRuntimeError('invalid endpoint'),
errorWithPos(new errors.AiScriptRuntimeError('invalid endpoint'), 2, 11),
);
expect(misskeyApiMock).not.toHaveBeenCalled();
});
@ -325,7 +336,7 @@ describe('AiScript common API', () => {
await expect(() => exe(`
Mk:api('ping')
`)).rejects.toStrictEqual(
new errors.AiScriptRuntimeError('expected param'),
errorWithPos(new errors.AiScriptRuntimeError('expected param'), 2, 11),
);
expect(misskeyApiMock).not.toHaveBeenCalled();
});
@ -353,7 +364,7 @@ describe('AiScript common API', () => {
await expect(() => exe(`
Mk:save('key')
`)).rejects.toStrictEqual(
new errors.AiScriptRuntimeError('Expect anything, but got nothing.'),
errorWithPos(new errors.AiScriptRuntimeError('Expect anything, but got nothing.'), 2, 12),
);
});

View File

@ -316,10 +316,11 @@ describe('AiScript UI API', () => {
describe('textInput', () => {
test.concurrent('all options', async () => {
// https://github.com/aiscript-dev/aiscript/pull/948
const { root, get, outputs } = await exe(`
let text_input = Ui:C:textInput({
onInput: print
default: 'a'
"default": 'a'
label: 'b'
caption: 'c'
}, 'id')
@ -356,10 +357,11 @@ describe('AiScript UI API', () => {
describe('textarea', () => {
test.concurrent('all options', async () => {
// https://github.com/aiscript-dev/aiscript/pull/948
const { root, get, outputs } = await exe(`
let textarea = Ui:C:textarea({
onInput: print
default: 'a'
"default": 'a'
label: 'b'
caption: 'c'
}, 'id')
@ -396,10 +398,11 @@ describe('AiScript UI API', () => {
describe('numberInput', () => {
test.concurrent('all options', async () => {
// https://github.com/aiscript-dev/aiscript/pull/948
const { root, get, outputs } = await exe(`
let number_input = Ui:C:numberInput({
onInput: print
default: 1
"default": 1
label: 'a'
caption: 'b'
}, 'id')
@ -557,10 +560,11 @@ describe('AiScript UI API', () => {
describe('switch', () => {
test.concurrent('all options', async () => {
// https://github.com/aiscript-dev/aiscript/pull/948
const { root, get, outputs } = await exe(`
let switch = Ui:C:switch({
onChange: print
default: false
"default": false
label: 'a'
caption: 'b'
}, 'id')
@ -597,6 +601,7 @@ describe('AiScript UI API', () => {
describe('select', () => {
test.concurrent('all options', async () => {
// https://github.com/aiscript-dev/aiscript/pull/948
const { root, get, outputs } = await exe(`
let select = Ui:C:select({
items: [
@ -604,7 +609,7 @@ describe('AiScript UI API', () => {
{ text: 'B', value: 'b' }
]
onChange: print
default: 'a'
"default": 'a'
label: 'c'
caption: 'd'
}, 'id')

View File

@ -1,7 +1,7 @@
{
"type": "module",
"name": "misskey-js",
"version": "2025.8.0-alpha.6",
"version": "2025.8.0-alpha.7",
"description": "Misskey SDK for JavaScript",
"license": "MIT",
"main": "./built/index.js",

File diff suppressed because it is too large Load Diff

View File

@ -9,16 +9,16 @@
"version": "1.0.0",
"devDependencies": {
"@types/mdast": "4.0.4",
"@types/node": "22.15.31",
"@vitest/coverage-v8": "3.2.3",
"@types/node": "22.17.1",
"@vitest/coverage-v8": "3.2.4",
"mdast-util-to-string": "4.0.0",
"remark": "15.0.1",
"remark-parse": "11.0.0",
"typescript": "5.8.3",
"typescript": "5.9.2",
"unified": "11.0.5",
"vite": "6.3.5",
"vite-node": "3.2.3",
"vitest": "3.2.3"
"vite-node": "3.2.4",
"vitest": "3.2.4"
}
},
"node_modules/@ampproject/remapping": {
@ -940,9 +940,9 @@
"dev": true
},
"node_modules/@types/node": {
"version": "22.15.31",
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.31.tgz",
"integrity": "sha512-jnVe5ULKl6tijxUhvQeNbQG/84fHfg+yMak02cT8QVhBx/F05rAVxCGBYYTh2EKz22D6JF5ktXuNwdx7b9iEGw==",
"version": "22.17.1",
"resolved": "https://registry.npmjs.org/@types/node/-/node-22.17.1.tgz",
"integrity": "sha512-y3tBaz+rjspDTylNjAX37jEC3TETEFGNJL6uQDxwF9/8GLLIjW1rvVHlynyuUKMnMr1Roq8jOv3vkopBjC4/VA==",
"dev": true,
"license": "MIT",
"dependencies": {
@ -956,9 +956,9 @@
"dev": true
},
"node_modules/@vitest/coverage-v8": {
"version": "3.2.3",
"resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-3.2.3.tgz",
"integrity": "sha512-D1QKzngg8PcDoCE8FHSZhREDuEy+zcKmMiMafYse41RZpBE5EDJyKOTdqK3RQfsV2S2nyKor5KCs8PyPRFqKPg==",
"version": "3.2.4",
"resolved": "https://registry.npmjs.org/@vitest/coverage-v8/-/coverage-v8-3.2.4.tgz",
"integrity": "sha512-EyF9SXU6kS5Ku/U82E259WSnvg6c8KTjppUncuNdm5QHpe17mwREHnjDzozC8x9MZ0xfBUFSaLkRv4TMA75ALQ==",
"dev": true,
"license": "MIT",
"dependencies": {
@ -980,8 +980,8 @@
"url": "https://opencollective.com/vitest"
},
"peerDependencies": {
"@vitest/browser": "3.2.3",
"vitest": "3.2.3"
"@vitest/browser": "3.2.4",
"vitest": "3.2.4"
},
"peerDependenciesMeta": {
"@vitest/browser": {
@ -990,15 +990,15 @@
}
},
"node_modules/@vitest/expect": {
"version": "3.2.3",
"resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-3.2.3.tgz",
"integrity": "sha512-W2RH2TPWVHA1o7UmaFKISPvdicFJH+mjykctJFoAkUw+SPTJTGjUNdKscFBrqM7IPnCVu6zihtKYa7TkZS1dkQ==",
"version": "3.2.4",
"resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-3.2.4.tgz",
"integrity": "sha512-Io0yyORnB6sikFlt8QW5K7slY4OjqNX9jmJQ02QDda8lyM6B5oNgVWoSoKPac8/kgnCUzuHQKrSLtu/uOqqrig==",
"dev": true,
"license": "MIT",
"dependencies": {
"@types/chai": "^5.2.2",
"@vitest/spy": "3.2.3",
"@vitest/utils": "3.2.3",
"@vitest/spy": "3.2.4",
"@vitest/utils": "3.2.4",
"chai": "^5.2.0",
"tinyrainbow": "^2.0.0"
},
@ -1007,13 +1007,13 @@
}
},
"node_modules/@vitest/mocker": {
"version": "3.2.3",
"resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-3.2.3.tgz",
"integrity": "sha512-cP6fIun+Zx8he4rbWvi+Oya6goKQDZK+Yq4hhlggwQBbrlOQ4qtZ+G4nxB6ZnzI9lyIb+JnvyiJnPC2AGbKSPA==",
"version": "3.2.4",
"resolved": "https://registry.npmjs.org/@vitest/mocker/-/mocker-3.2.4.tgz",
"integrity": "sha512-46ryTE9RZO/rfDd7pEqFl7etuyzekzEhUbTW3BvmeO/BcCMEgq59BKhek3dXDWgAj4oMK6OZi+vRr1wPW6qjEQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@vitest/spy": "3.2.3",
"@vitest/spy": "3.2.4",
"estree-walker": "^3.0.3",
"magic-string": "^0.30.17"
},
@ -1034,9 +1034,9 @@
}
},
"node_modules/@vitest/pretty-format": {
"version": "3.2.3",
"resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-3.2.3.tgz",
"integrity": "sha512-yFglXGkr9hW/yEXngO+IKMhP0jxyFw2/qys/CK4fFUZnSltD+MU7dVYGrH8rvPcK/O6feXQA+EU33gjaBBbAng==",
"version": "3.2.4",
"resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-3.2.4.tgz",
"integrity": "sha512-IVNZik8IVRJRTr9fxlitMKeJeXFFFN0JaB9PHPGQ8NKQbGpfjlTx9zO4RefN8gp7eqjNy8nyK3NZmBzOPeIxtA==",
"dev": true,
"license": "MIT",
"dependencies": {
@ -1047,13 +1047,13 @@
}
},
"node_modules/@vitest/runner": {
"version": "3.2.3",
"resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-3.2.3.tgz",
"integrity": "sha512-83HWYisT3IpMaU9LN+VN+/nLHVBCSIUKJzGxC5RWUOsK1h3USg7ojL+UXQR3b4o4UBIWCYdD2fxuzM7PQQ1u8w==",
"version": "3.2.4",
"resolved": "https://registry.npmjs.org/@vitest/runner/-/runner-3.2.4.tgz",
"integrity": "sha512-oukfKT9Mk41LreEW09vt45f8wx7DordoWUZMYdY/cyAk7w5TWkTRCNZYF7sX7n2wB7jyGAl74OxgwhPgKaqDMQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@vitest/utils": "3.2.3",
"@vitest/utils": "3.2.4",
"pathe": "^2.0.3",
"strip-literal": "^3.0.0"
},
@ -1062,13 +1062,13 @@
}
},
"node_modules/@vitest/snapshot": {
"version": "3.2.3",
"resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-3.2.3.tgz",
"integrity": "sha512-9gIVWx2+tysDqUmmM1L0hwadyumqssOL1r8KJipwLx5JVYyxvVRfxvMq7DaWbZZsCqZnu/dZedaZQh4iYTtneA==",
"version": "3.2.4",
"resolved": "https://registry.npmjs.org/@vitest/snapshot/-/snapshot-3.2.4.tgz",
"integrity": "sha512-dEYtS7qQP2CjU27QBC5oUOxLE/v5eLkGqPE0ZKEIDGMs4vKWe7IjgLOeauHsR0D5YuuycGRO5oSRXnwnmA78fQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@vitest/pretty-format": "3.2.3",
"@vitest/pretty-format": "3.2.4",
"magic-string": "^0.30.17",
"pathe": "^2.0.3"
},
@ -1077,9 +1077,9 @@
}
},
"node_modules/@vitest/spy": {
"version": "3.2.3",
"resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-3.2.3.tgz",
"integrity": "sha512-JHu9Wl+7bf6FEejTCREy+DmgWe+rQKbK+y32C/k5f4TBIAlijhJbRBIRIOCEpVevgRsCQR2iHRUH2/qKVM/plw==",
"version": "3.2.4",
"resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-3.2.4.tgz",
"integrity": "sha512-vAfasCOe6AIK70iP5UD11Ac4siNUNJ9i/9PZ3NKx07sG6sUxeag1LWdNrMWeKKYBLlzuK+Gn65Yd5nyL6ds+nw==",
"dev": true,
"license": "MIT",
"dependencies": {
@ -1090,14 +1090,14 @@
}
},
"node_modules/@vitest/utils": {
"version": "3.2.3",
"resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-3.2.3.tgz",
"integrity": "sha512-4zFBCU5Pf+4Z6v+rwnZ1HU1yzOKKvDkMXZrymE2PBlbjKJRlrOxbvpfPSvJTGRIwGoahaOGvp+kbCoxifhzJ1Q==",
"version": "3.2.4",
"resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-3.2.4.tgz",
"integrity": "sha512-fB2V0JFrQSMsCo9HiSq3Ezpdv4iYaXRG1Sx8edX3MwxfyNn83mKiGzOcH+Fkxt4MHxr3y42fQi1oeAInqgX2QA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@vitest/pretty-format": "3.2.3",
"loupe": "^3.1.3",
"@vitest/pretty-format": "3.2.4",
"loupe": "^3.1.4",
"tinyrainbow": "^2.0.0"
},
"funding": {
@ -1607,9 +1607,9 @@
}
},
"node_modules/loupe": {
"version": "3.1.3",
"resolved": "https://registry.npmjs.org/loupe/-/loupe-3.1.3.tgz",
"integrity": "sha512-kkIp7XSkP78ZxJEsSxW3712C6teJVoeHHwgo9zJ380de7IYyJ2ISlxojcH2pC5OFLewESmnRi/+XCDIEEVyoug==",
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/loupe/-/loupe-3.2.0.tgz",
"integrity": "sha512-2NCfZcT5VGVNX9mSZIxLRkEAegDGBpuQZBy13desuHeVORmBDyAET4TkJr4SjqQy3A8JDofMN6LpkK8Xcm/dlw==",
"dev": true,
"license": "MIT"
},
@ -2672,9 +2672,9 @@
}
},
"node_modules/tinypool": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.1.0.tgz",
"integrity": "sha512-7CotroY9a8DKsKprEy/a14aCCm8jYVmR7aFy4fpkZM8sdpNJbKkixuNjgM50yCmip2ezc8z4N7k3oe2+rfRJCQ==",
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/tinypool/-/tinypool-1.1.1.tgz",
"integrity": "sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==",
"dev": true,
"license": "MIT",
"engines": {
@ -2712,9 +2712,9 @@
}
},
"node_modules/typescript": {
"version": "5.8.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz",
"integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==",
"version": "5.9.2",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.2.tgz",
"integrity": "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==",
"dev": true,
"license": "Apache-2.0",
"bin": {
@ -2912,9 +2912,9 @@
}
},
"node_modules/vite-node": {
"version": "3.2.3",
"resolved": "https://registry.npmjs.org/vite-node/-/vite-node-3.2.3.tgz",
"integrity": "sha512-gc8aAifGuDIpZHrPjuHyP4dpQmYXqWw7D1GmDnWeNWP654UEXzVfQ5IHPSK5HaHkwB/+p1atpYpSdw/2kOv8iQ==",
"version": "3.2.4",
"resolved": "https://registry.npmjs.org/vite-node/-/vite-node-3.2.4.tgz",
"integrity": "sha512-EbKSKh+bh1E1IFxeO0pg1n4dvoOTt0UDiXMd/qn++r98+jPO1xtJilvXldeuQ8giIB5IkpjCgMleHMNEsGH6pg==",
"dev": true,
"license": "MIT",
"dependencies": {
@ -2935,20 +2935,20 @@
}
},
"node_modules/vitest": {
"version": "3.2.3",
"resolved": "https://registry.npmjs.org/vitest/-/vitest-3.2.3.tgz",
"integrity": "sha512-E6U2ZFXe3N/t4f5BwUaVCKRLHqUpk1CBWeMh78UT4VaTPH/2dyvH6ALl29JTovEPu9dVKr/K/J4PkXgrMbw4Ww==",
"version": "3.2.4",
"resolved": "https://registry.npmjs.org/vitest/-/vitest-3.2.4.tgz",
"integrity": "sha512-LUCP5ev3GURDysTWiP47wRRUpLKMOfPh+yKTx3kVIEiu5KOMeqzpnYNsKyOoVrULivR8tLcks4+lga33Whn90A==",
"dev": true,
"license": "MIT",
"dependencies": {
"@types/chai": "^5.2.2",
"@vitest/expect": "3.2.3",
"@vitest/mocker": "3.2.3",
"@vitest/pretty-format": "^3.2.3",
"@vitest/runner": "3.2.3",
"@vitest/snapshot": "3.2.3",
"@vitest/spy": "3.2.3",
"@vitest/utils": "3.2.3",
"@vitest/expect": "3.2.4",
"@vitest/mocker": "3.2.4",
"@vitest/pretty-format": "^3.2.4",
"@vitest/runner": "3.2.4",
"@vitest/snapshot": "3.2.4",
"@vitest/spy": "3.2.4",
"@vitest/utils": "3.2.4",
"chai": "^5.2.0",
"debug": "^4.4.1",
"expect-type": "^1.2.1",
@ -2959,10 +2959,10 @@
"tinybench": "^2.9.0",
"tinyexec": "^0.3.2",
"tinyglobby": "^0.2.14",
"tinypool": "^1.1.0",
"tinypool": "^1.1.1",
"tinyrainbow": "^2.0.0",
"vite": "^5.0.0 || ^6.0.0 || ^7.0.0-0",
"vite-node": "3.2.3",
"vite-node": "3.2.4",
"why-is-node-running": "^2.3.0"
},
"bin": {
@ -2978,8 +2978,8 @@
"@edge-runtime/vm": "*",
"@types/debug": "^4.1.12",
"@types/node": "^18.0.0 || ^20.0.0 || >=22.0.0",
"@vitest/browser": "3.2.3",
"@vitest/ui": "3.2.3",
"@vitest/browser": "3.2.4",
"@vitest/ui": "3.2.4",
"happy-dom": "*",
"jsdom": "*"
},

View File

@ -10,15 +10,15 @@
},
"devDependencies": {
"@types/mdast": "4.0.4",
"@types/node": "22.15.31",
"@vitest/coverage-v8": "3.2.3",
"@types/node": "22.17.1",
"@vitest/coverage-v8": "3.2.4",
"mdast-util-to-string": "4.0.0",
"remark": "15.0.1",
"remark-parse": "11.0.0",
"typescript": "5.8.3",
"typescript": "5.9.2",
"unified": "11.0.5",
"vite": "6.3.5",
"vite-node": "3.2.3",
"vitest": "3.2.3"
"vite-node": "3.2.4",
"vitest": "3.2.4"
}
}