diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2023-12-27 21:28:38 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-27 21:28:38 +0900 |
| commit | 53898c50066366b23c507775c655599587a91673 (patch) | |
| tree | 537c9ef74f189bf9984ef3f0c3da4eded1a4aec9 /packages/frontend/src/scripts/aiscript/ui.ts | |
| parent | Merge pull request #12564 from misskey-dev/develop (diff) | |
| parent | 2023.12.1 (diff) | |
| download | misskey-53898c50066366b23c507775c655599587a91673.tar.gz misskey-53898c50066366b23c507775c655599587a91673.tar.bz2 misskey-53898c50066366b23c507775c655599587a91673.zip | |
Merge pull request #12771 from misskey-dev/develop
Release: 2023.12.1
Diffstat (limited to 'packages/frontend/src/scripts/aiscript/ui.ts')
| -rw-r--r-- | packages/frontend/src/scripts/aiscript/ui.ts | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/packages/frontend/src/scripts/aiscript/ui.ts b/packages/frontend/src/scripts/aiscript/ui.ts index 75b9248432..08ba1e6d9b 100644 --- a/packages/frontend/src/scripts/aiscript/ui.ts +++ b/packages/frontend/src/scripts/aiscript/ui.ts @@ -47,6 +47,7 @@ export type AsUiMfm = AsUiComponentBase & { bold?: boolean; color?: string; font?: 'serif' | 'sans-serif' | 'monospace'; + onClickEv?: (evId: string) => void }; export type AsUiButton = AsUiComponentBase & { @@ -230,6 +231,8 @@ function getMfmOptions(def: values.Value | undefined): Omit<AsUiMfm, 'id' | 'typ if (color) utils.assertString(color); const font = def.value.get('font'); if (font) utils.assertString(font); + const onClickEv = def.value.get('onClickEv'); + if (onClickEv) utils.assertFunction(onClickEv); return { text: text?.value, @@ -237,6 +240,9 @@ function getMfmOptions(def: values.Value | undefined): Omit<AsUiMfm, 'id' | 'typ bold: bold?.value, color: color?.value, font: font?.value, + onClickEv: (evId: string) => { + if (onClickEv) call(onClickEv, values.STR(evId)); + }, }; } |