mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2024-12-12 09:26:33 +01:00
5cb319771d
* set pipe to empty string on empty closure * fix missing parser flags and scope * add closure serializing * add enum provider function to slash command arguments * add enum providers for /bg, /ask, and /go * fix index out of bounds returning undefined * keep whitespace as is in mixed unnamed args (string+closure) * add _hasUnnamedArgument to named arguments dictionary * allow /var key=x retrieval * add enum provider to /tag-add * fix typo (case) * add option to make enum matching optional * add executor to enum provider * change /tag-add enum provider to only show tags not already assigned * add enum provider to /tag-remove * fix name enum provider excluding groups * remove void from slash command callback return types * Lint undefined and null pipes * enable pointer events in chat autocomplete * fix type hint --------- Co-authored-by: LenAnderson <Anderson.Len@outlook.com> Co-authored-by: Cohee <18619528+Cohee1207@users.noreply.github.com>
35 lines
971 B
JavaScript
35 lines
971 B
JavaScript
import { AutoCompleteOption } from '../autocomplete/AutoCompleteOption.js';
|
|
import { SlashCommand } from './SlashCommand.js';
|
|
import { SlashCommandEnumValue } from './SlashCommandEnumValue.js';
|
|
|
|
export class SlashCommandEnumAutoCompleteOption extends AutoCompleteOption {
|
|
/**@type {SlashCommand}*/ cmd;
|
|
/**@type {SlashCommandEnumValue}*/ enumValue;
|
|
|
|
|
|
|
|
/**
|
|
* @param {SlashCommand} cmd
|
|
* @param {SlashCommandEnumValue} enumValue
|
|
*/
|
|
constructor(cmd, enumValue) {
|
|
super(enumValue.value, enumValue.typeIcon, enumValue.type);
|
|
this.cmd = cmd;
|
|
this.enumValue = enumValue;
|
|
}
|
|
|
|
|
|
renderItem() {
|
|
let li;
|
|
li = this.makeItem(this.name, this.typeIcon, true, [], [], null, this.enumValue.description);
|
|
li.setAttribute('data-name', this.name);
|
|
li.setAttribute('data-option-type', this.type);
|
|
return li;
|
|
}
|
|
|
|
|
|
renderDetails() {
|
|
return this.cmd.renderHelpDetails();
|
|
}
|
|
}
|