From d8a18821939fb852c1c41bf6c6ff5d736455e940 Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih Date: Tue, 24 Oct 2023 23:42:12 +0900 Subject: [PATCH 1/3] feat(AiScript): Mk:nyaize --- packages/frontend/src/scripts/aiscript/api.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/frontend/src/scripts/aiscript/api.ts b/packages/frontend/src/scripts/aiscript/api.ts index 032853f7ad30..df5edcf3db67 100644 --- a/packages/frontend/src/scripts/aiscript/api.ts +++ b/packages/frontend/src/scripts/aiscript/api.ts @@ -9,6 +9,7 @@ import { $i } from '@/account.js'; import { miLocalStorage } from '@/local-storage.js'; import { customEmojis } from '@/custom-emojis.js'; import { url, lang } from '@/config.js'; +import { nyaize } from '../nyaize.js'; export function createAiScriptEnv(opts) { return { @@ -71,5 +72,9 @@ export function createAiScriptEnv(opts) { 'Mk:url': values.FN_NATIVE(() => { return values.STR(window.location.href); }), + 'Mk:nyaize': values.FN_NATIVE(([text]) => { + utils.assertString(text); + return values.STR(nyaize(text.value)); + }), }; } From e8d0a018ad08fe700ccda2c85ff406fb016e78a5 Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih Date: Tue, 24 Oct 2023 23:42:59 +0900 Subject: [PATCH 2/3] Update Changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0f875b4b704f..c693748f6777 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ - Feat: プラグイン・テーマを外部サイトから直接インストールできるようになりました - 外部サイトでの実装が必要です。詳細は Misskey Hub をご覧ください https://misskey-hub.net/docs/advanced/publish-on-your-website.html +- Feat: AiScript関数`Mk:nyaize()`が追加されました - Fix: 投稿フォームでのユーザー変更がプレビューに反映されない問題を修正 ### Server From 6fffae746a7ec94fb62161968131107a1f03f6db Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih Date: Tue, 24 Oct 2023 23:45:00 +0900 Subject: [PATCH 3/3] Fix relative path --- packages/frontend/src/scripts/aiscript/api.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/frontend/src/scripts/aiscript/api.ts b/packages/frontend/src/scripts/aiscript/api.ts index df5edcf3db67..fb7ab924b7ad 100644 --- a/packages/frontend/src/scripts/aiscript/api.ts +++ b/packages/frontend/src/scripts/aiscript/api.ts @@ -9,7 +9,7 @@ import { $i } from '@/account.js'; import { miLocalStorage } from '@/local-storage.js'; import { customEmojis } from '@/custom-emojis.js'; import { url, lang } from '@/config.js'; -import { nyaize } from '../nyaize.js'; +import { nyaize } from '@/scripts/nyaize.js'; export function createAiScriptEnv(opts) { return {