Merge branch 'staging' into webpack

This commit is contained in:
Cohee
2024-10-26 19:11:29 +03:00
12 changed files with 90 additions and 11 deletions

View File

@ -1397,6 +1397,13 @@ export function initDefaultSlashCommands() {
callback: popupCallback,
returns: 'popup text',
namedArgumentList: [
SlashCommandNamedArgument.fromProps({
name: 'scroll',
description: 'allows vertical scrolling of the content',
typeList: [ARGUMENT_TYPE.BOOLEAN],
enumList: commonEnumProviders.boolean('trueFalse')(),
defaultValue: 'true',
}),
SlashCommandNamedArgument.fromProps({
name: 'large',
description: 'show large popup',
@ -2093,7 +2100,7 @@ async function buttonsCallback(args, text) {
popupContainer.innerHTML = safeValue;
popupContainer.appendChild(buttonContainer);
popup = new Popup(popupContainer, POPUP_TYPE.TEXT, '', { okButton: 'Cancel' });
popup = new Popup(popupContainer, POPUP_TYPE.TEXT, '', { okButton: 'Cancel', allowVerticalScrolling: true });
popup.show()
.then((result => resolve(typeof result === 'number' ? resultToButtonMap.get(result) ?? '' : '')))
.catch(() => resolve(''));
@ -2110,6 +2117,7 @@ async function popupCallback(args, value) {
/** @type {import('./popup.js').PopupOptions} */
const popupOptions = {
allowVerticalScrolling: !isFalseBoolean(args?.scroll),
large: isTrueBoolean(args?.large),
wide: isTrueBoolean(args?.wide),
wider: isTrueBoolean(args?.wider),