Fields
Smart Text Field
The smart_text field allows you to enable autocompletions and syntax highlighting in your text.
This field can be used to add suggestions to any text field.
The suggestions will be displayed as the user types, and the user can select one of the suggestions to complete the text.
Basic usage
Adds a smart_text
field to the fields of an action.
This field will show autocompletions when the user types @
or presses Ctrl+Space.
Result
The field will be displayed as a text input field as below:
The resultant data will be available in the stubpost.data
as:
This can be substituted with eg. ~~stubpost.data.smart_text_mention_field
where required.
Parameters
See fields for common field parameters like validation and conditional rendering.
params.parse_string
If set to true
, string values will be parsed and the field's output will be a number or a boolean when parsed successfully.
Default: false
optional
params.code_language Adds syntax highlighting for the chosen language.
Currently only 'handlebars'
is supported.
optional
params.auto_completions An array of auto_completion
objects that define the autocompletions for the field.
optional
auto_completion.explicit If set to true
, the associated options will be shown when the user presses Ctrl+Space.
optional
auto_completion.match_before A regex expression/character that will trigger the autocompletions panel to appear.
auto_completion.options
An array of objects that define the autocompletions for the field.
The properties defined on codemirror.net's Completion interface are supported.