File tree Expand file tree Collapse file tree
botonic-plugin-ai-agents/src/structured-output
botonic-plugin-flow-builder/src/content-fields Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ export interface Button {
1414 text : string
1515 payload ?: string
1616 url ?: string
17+ target ?: string
1718}
1819export interface ButtonWithPayload {
1920 text : string
Original file line number Diff line number Diff line change @@ -12,6 +12,14 @@ export const TextWithButtonsSchema = z
1212 z . object ( {
1313 text : z . string ( ) ,
1414 url : z . string ( ) . nullable ( ) . optional ( ) ,
15+ target : z
16+ . enum ( [ '_blank' , '_self' ] )
17+ . default ( '_blank' )
18+ . nullable ( )
19+ . optional ( )
20+ . describe (
21+ 'The target of the button when it has an url. If not provided, it will default to _blank.'
22+ ) ,
1523 } )
1624 ) ,
1725 } ) ,
Original file line number Diff line number Diff line change @@ -92,11 +92,13 @@ export class FlowButton extends ContentFieldsBase {
9292 text : string
9393 payload ?: string
9494 url ?: string
95+ target ?: string
9596 } ) : FlowButton {
9697 const newButton = new FlowButton ( button . id )
9798 newButton . text = button . text
9899 if ( button . url ) {
99100 newButton . url = button . url
101+ newButton . target = button . target
100102 } else {
101103 newButton . payload = button . payload
102104 }
Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ export class FlowText extends ContentFieldsBase {
5757 id : `${ id } -button-${ buttonIndex } ` ,
5858 text : button . text ,
5959 url : button . url ,
60+ target : button . target ,
6061 payload :
6162 button . payload ||
6263 `${ EMPTY_PAYLOAD } ${ SOURCE_INFO_SEPARATOR } ${ buttonIndex } ` ,
You can’t perform that action at this time.
0 commit comments