@@ -19,6 +19,10 @@ const outputTypeOptions = [
19
19
name : 'Triton Placeholders ([lang] tags)' ,
20
20
value : 'triton_placeholders' ,
21
21
} ,
22
+ {
23
+ name : 'Triton Placeholders (Custom Tags)' ,
24
+ value : 'triton_placeholders_custom' ,
25
+ } ,
22
26
{
23
27
name : 'Placeholder API' ,
24
28
value : 'papi' ,
@@ -31,9 +35,14 @@ const InputForm = () => {
31
35
const [ variableRegex , setVariableRegex ] = useState ( '' ) ;
32
36
const [ outputType , setOutputType ] = useState ( 'triton_placeholders' ) ;
33
37
const [ ignoredKeys , setIgnoredKeys ] = useState ( '' ) ;
38
+ const [ langSyntax , setLangSyntax ] = useState ( 'lang' ) ;
39
+ const [ argSyntax , setArgSyntax ] = useState ( 'arg' ) ;
40
+ const [ argsSyntax , setArgsSyntax ] = useState ( 'args' ) ;
34
41
const [ levelDelimiter , setLevelDelimiter ] = useState ( '.' ) ;
35
42
const [ files , setFiles ] = useState ( [ ] ) ;
36
43
44
+ const isCustomPlaceholders = outputType === 'triton_placeholders_custom' ;
45
+
37
46
return (
38
47
< form className = { classes . root } noValidate autoComplete = 'off' >
39
48
< TextField
@@ -61,6 +70,40 @@ const InputForm = () => {
61
70
value = { outputType }
62
71
onChange = { handleFieldChange ( setOutputType ) }
63
72
/>
73
+ { isCustomPlaceholders && (
74
+ < >
75
+ < TextField
76
+ label = 'Lang Syntax'
77
+ value = { langSyntax }
78
+ onChange = { handleFieldChange ( setLangSyntax ) }
79
+ placeholder = 'lang'
80
+ helperText = { `Custom lang tag you want to use. Start tag [${ langSyntax } ] and end tags [/${ langSyntax } ] are added automatically.` }
81
+ margin = 'normal'
82
+ variant = 'outlined'
83
+ fullWidth
84
+ />
85
+ < TextField
86
+ label = 'Args Syntax'
87
+ value = { argsSyntax }
88
+ onChange = { handleFieldChange ( setArgsSyntax ) }
89
+ placeholder = 'args'
90
+ helperText = { `Custom args tag you want to use. Start tag [${ argsSyntax } ] and end tags [/${ argsSyntax } ] are added automatically.` }
91
+ margin = 'normal'
92
+ variant = 'outlined'
93
+ fullWidth
94
+ />
95
+ < TextField
96
+ label = 'Arg Syntax'
97
+ value = { argSyntax }
98
+ onChange = { handleFieldChange ( setArgSyntax ) }
99
+ placeholder = 'arg'
100
+ helperText = { `Custom arg tag you want to use. Start tag [${ argSyntax } ] and end tags [/${ argSyntax } ] are added automatically.` }
101
+ margin = 'normal'
102
+ variant = 'outlined'
103
+ fullWidth
104
+ />
105
+ </ >
106
+ ) }
64
107
< TextField
65
108
label = 'Level Delimiter'
66
109
value = { levelDelimiter }
@@ -85,6 +128,9 @@ const InputForm = () => {
85
128
prefix = { prefix }
86
129
variableRegex = { variableRegex }
87
130
outputType = { outputType }
131
+ langSyntax = { langSyntax }
132
+ argsSyntax = { argsSyntax }
133
+ argSyntax = { argsSyntax }
88
134
ignoredKeys = { ignoredKeys }
89
135
levelDelimiter = { levelDelimiter }
90
136
files = { files }
0 commit comments