diff --git a/CHANGELOG.md b/CHANGELOG.md index 683c0a85a5df3d38d2efc1833d0b5a897923e4c4..d96556ec0d39a2717f86e70c727a9b25dd19dbfe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -57,6 +57,7 @@ - AiScriptã‚’0.16.0ã«æ›´æ–° - Mk:apiãŒå¤±æ•—ã—ãŸæ™‚ã«ã‚¨ãƒ©ãƒ¼åž‹ã®å€¤ï¼ˆAiScript 0.16.0ã§è¿½åŠ )を返ã™ã‚ˆã†ã« - タイムラインã§ãƒªã‚¹ãƒˆ/アンテナé¸æŠžæ™‚ã®ãƒ‘フォーマンスを改善 +- Scratchpadã§Async:系関数やボタンã®ã‚³ãƒ¼ãƒ«ãƒãƒƒã‚¯ãªã©ã®ã‚¨ãƒ©ãƒ¼ã«ã‚‚ダイアãƒã‚°ã‚’出ã™ã‚ˆã†ã«ï¼ˆè©¦é¨“çš„ãªãŸã‚Playãªã©ã«ã¯æœªå®Ÿè£…) - 「Moderation noteã€ã€ã€ŒAdd moderation noteã€ã‚’ãƒãƒ¼ã‚«ãƒ©ã‚¤ã‚ºã§ãるよã†ã« - æ–°ã—ã„å®Ÿç¸¾ã‚’è¿½åŠ - Fix: サーãƒãƒ¼æƒ…å ±ç”»é¢(`/instance-info/{domain}`)ã§ãƒ–ãƒãƒƒã‚¯ãŒã§ããªã„ã®ã‚’ä¿®æ£ diff --git a/packages/frontend/src/pages/scratchpad.vue b/packages/frontend/src/pages/scratchpad.vue index 8d5a29d3941c8cf6ce54e83e16ee6f6e38106c6d..3dfd2d661f7eb78bde9ccca4011937e7ca4b928a 100644 --- a/packages/frontend/src/pages/scratchpad.vue +++ b/packages/frontend/src/pages/scratchpad.vue @@ -109,6 +109,13 @@ async function run() { print: true, }); }, + err: (err) => { + os.alert({ + type: 'error', + title: 'AiScript Error', + text: err.toString(), + }); + }, log: (type, params) => { switch (type) { case 'end': logs.value.push({ @@ -124,20 +131,23 @@ async function run() { let ast; try { ast = parser.parse(code.value); - } catch (error) { + } catch (err: any) { os.alert({ type: 'error', - text: 'Syntax error :(', + title: 'Syntax Error', + text: err.toString(), }); return; } try { await aiscript.exec(ast); } catch (err: any) { + // AiScript runtime errors should be processed by error callback function + // so errors caught here are AiScript's internal errors. os.alert({ type: 'error', - title: 'AiScript Error', - text: err.message, + title: 'Internal Error', + text: err.toString(), }); } } diff --git a/packages/frontend/src/scripts/aiscript/ui.ts b/packages/frontend/src/scripts/aiscript/ui.ts index 7e17563ec8430b6c43952c0c8788fff4fd436d5b..d326b956e89244ecb8f2f903239c41c754ee8106 100644 --- a/packages/frontend/src/scripts/aiscript/ui.ts +++ b/packages/frontend/src/scripts/aiscript/ui.ts @@ -551,55 +551,55 @@ export function registerAsUiLib(components: Ref<AsUiComponent>[], done: (root: R }), 'Ui:C:container': values.FN_NATIVE(([def, id], opts) => { - return createComponentInstance('container', def, id, getContainerOptions, opts.call); + return createComponentInstance('container', def, id, getContainerOptions, opts.topCall); }), 'Ui:C:text': values.FN_NATIVE(([def, id], opts) => { - return createComponentInstance('text', def, id, getTextOptions, opts.call); + return createComponentInstance('text', def, id, getTextOptions, opts.topCall); }), 'Ui:C:mfm': values.FN_NATIVE(([def, id], opts) => { - return createComponentInstance('mfm', def, id, getMfmOptions, opts.call); + return createComponentInstance('mfm', def, id, getMfmOptions, opts.topCall); }), 'Ui:C:textarea': values.FN_NATIVE(([def, id], opts) => { - return createComponentInstance('textarea', def, id, getTextareaOptions, opts.call); + return createComponentInstance('textarea', def, id, getTextareaOptions, opts.topCall); }), 'Ui:C:textInput': values.FN_NATIVE(([def, id], opts) => { - return createComponentInstance('textInput', def, id, getTextInputOptions, opts.call); + return createComponentInstance('textInput', def, id, getTextInputOptions, opts.topCall); }), 'Ui:C:numberInput': values.FN_NATIVE(([def, id], opts) => { - return createComponentInstance('numberInput', def, id, getNumberInputOptions, opts.call); + return createComponentInstance('numberInput', def, id, getNumberInputOptions, opts.topCall); }), 'Ui:C:button': values.FN_NATIVE(([def, id], opts) => { - return createComponentInstance('button', def, id, getButtonOptions, opts.call); + return createComponentInstance('button', def, id, getButtonOptions, opts.topCall); }), 'Ui:C:buttons': values.FN_NATIVE(([def, id], opts) => { - return createComponentInstance('buttons', def, id, getButtonsOptions, opts.call); + return createComponentInstance('buttons', def, id, getButtonsOptions, opts.topCall); }), 'Ui:C:switch': values.FN_NATIVE(([def, id], opts) => { - return createComponentInstance('switch', def, id, getSwitchOptions, opts.call); + return createComponentInstance('switch', def, id, getSwitchOptions, opts.topCall); }), 'Ui:C:select': values.FN_NATIVE(([def, id], opts) => { - return createComponentInstance('select', def, id, getSelectOptions, opts.call); + return createComponentInstance('select', def, id, getSelectOptions, opts.topCall); }), 'Ui:C:folder': values.FN_NATIVE(([def, id], opts) => { - return createComponentInstance('folder', def, id, getFolderOptions, opts.call); + return createComponentInstance('folder', def, id, getFolderOptions, opts.topCall); }), 'Ui:C:postFormButton': values.FN_NATIVE(([def, id], opts) => { - return createComponentInstance('postFormButton', def, id, getPostFormButtonOptions, opts.call); + return createComponentInstance('postFormButton', def, id, getPostFormButtonOptions, opts.topCall); }), 'Ui:C:postForm': values.FN_NATIVE(([def, id], opts) => { - return createComponentInstance('postForm', def, id, getPostFormOptions, opts.call); + return createComponentInstance('postForm', def, id, getPostFormOptions, opts.topCall); }), }; }