Merge branch 'SillyTavern:release' into enhancement-make-buttons-scrollable

This commit is contained in:
joenunezb
2024-11-17 15:07:51 -08:00
committed by GitHub
14 changed files with 145 additions and 15 deletions

View File

@ -1395,6 +1395,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',
@ -2125,7 +2132,7 @@ async function buttonsCallback(args, text) {
popupContainer.style.flexDirection = 'column';
popupContainer.style.maxHeight = '80vh'; // Limit the overall height of the popup
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(''));
@ -2142,6 +2149,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),