Add wider and transparent styles to /popup

This commit is contained in:
Wolfsblvt 2024-09-06 22:22:35 +02:00
parent 3bea7d4885
commit a9e4bef01b

View File

@ -1273,6 +1273,12 @@ export function initDefaultSlashCommands() {
new SlashCommandNamedArgument( new SlashCommandNamedArgument(
'wide', 'show wide popup', [ARGUMENT_TYPE.BOOLEAN], false, false, null, commonEnumProviders.boolean('onOff')(), 'wide', 'show wide popup', [ARGUMENT_TYPE.BOOLEAN], false, false, null, commonEnumProviders.boolean('onOff')(),
), ),
new SlashCommandNamedArgument(
'wider', 'show wider popup', [ARGUMENT_TYPE.BOOLEAN], false, false, null, commonEnumProviders.boolean('onOff')(),
),
new SlashCommandNamedArgument(
'transparent', 'show transparent popup', [ARGUMENT_TYPE.BOOLEAN], false, false, null, commonEnumProviders.boolean('onOff')(),
),
new SlashCommandNamedArgument( new SlashCommandNamedArgument(
'okButton', 'text for the OK button', [ARGUMENT_TYPE.STRING], false, 'okButton', 'text for the OK button', [ARGUMENT_TYPE.STRING], false,
), ),
@ -1883,9 +1889,12 @@ async function buttonsCallback(args, text) {
async function popupCallback(args, value) { async function popupCallback(args, value) {
const safeValue = DOMPurify.sanitize(value || ''); const safeValue = DOMPurify.sanitize(value || '');
/** @type {import('./popup.js').PopupOptions} */
const popupOptions = { const popupOptions = {
large: isTrueBoolean(args?.large), large: isTrueBoolean(args?.large),
wide: isTrueBoolean(args?.wide), wide: isTrueBoolean(args?.wide),
wider: isTrueBoolean(args?.wider),
transparent: isTrueBoolean(args?.transparent),
okButton: args?.okButton !== undefined && typeof args?.okButton === 'string' ? args.okButton : 'Ok', okButton: args?.okButton !== undefined && typeof args?.okButton === 'string' ? args.okButton : 'Ok',
}; };
await delay(1); await delay(1);