File tree Expand file tree Collapse file tree 7 files changed +33
-14
lines changed Expand file tree Collapse file tree 7 files changed +33
-14
lines changed Original file line number Diff line number Diff line change 1
1
import React , { useState } from 'react' ;
2
2
import ToolContent from '@components/ToolContent' ;
3
- import ToolTextInput from '@components/input/ToolTextInput ' ;
3
+ import ToolCodeInput from '@components/input/ToolCodeInput ' ;
4
4
import ToolTextResult from '@components/result/ToolTextResult' ;
5
5
import { escapeJson } from './service' ;
6
6
import { CardExampleType } from '@components/examples/ToolExamples' ;
@@ -88,7 +88,12 @@ export default function EscapeJsonTool({
88
88
< ToolContent
89
89
title = { title }
90
90
inputComponent = {
91
- < ToolTextInput title = "Input JSON" value = { input } onChange = { setInput } />
91
+ < ToolCodeInput
92
+ title = "Input JSON"
93
+ value = { input }
94
+ onChange = { setInput }
95
+ language = "json"
96
+ />
92
97
}
93
98
resultComponent = {
94
99
< ToolTextResult
Original file line number Diff line number Diff line change 1
1
import { useState } from 'react' ;
2
2
import ToolContent from '@components/ToolContent' ;
3
- import ToolTextInput from '@components/input/ToolTextInput ' ;
3
+ import ToolCodeInput from '@components/input/ToolCodeInput ' ;
4
4
import ToolTextResult from '@components/result/ToolTextResult' ;
5
5
import { convertJsonToXml } from './service' ;
6
6
import { CardExampleType } from '@components/examples/ToolExamples' ;
@@ -84,7 +84,12 @@ export default function JsonToXml({ title }: ToolComponentProps) {
84
84
compute = { compute }
85
85
exampleCards = { exampleCards }
86
86
inputComponent = {
87
- < ToolTextInput title = "Input Json" value = { input } onChange = { setInput } />
87
+ < ToolCodeInput
88
+ title = "Input Json"
89
+ value = { input }
90
+ onChange = { setInput }
91
+ language = "json"
92
+ />
88
93
}
89
94
resultComponent = {
90
95
< ToolTextResult title = "Output XML" value = { result } extension = { 'xml' } />
Original file line number Diff line number Diff line change 1
1
import React , { useState } from 'react' ;
2
2
import ToolContent from '@components/ToolContent' ;
3
- import ToolTextInput from '@components/input/ToolTextInput ' ;
3
+ import ToolCodeInput from '@components/input/ToolCodeInput ' ;
4
4
import ToolTextResult from '@components/result/ToolTextResult' ;
5
5
import { minifyJson } from './service' ;
6
6
import { CardExampleType } from '@components/examples/ToolExamples' ;
@@ -60,10 +60,11 @@ export default function MinifyJson({ title }: ToolComponentProps) {
60
60
< ToolContent
61
61
title = { title }
62
62
inputComponent = {
63
- < ToolTextInput
63
+ < ToolCodeInput
64
64
title = { t ( 'minify.inputTitle' ) }
65
65
value = { input }
66
66
onChange = { setInput }
67
+ language = "json"
67
68
/>
68
69
}
69
70
resultComponent = {
Original file line number Diff line number Diff line change 1
1
import { Box } from '@mui/material' ;
2
2
import React , { useRef , useState } from 'react' ;
3
- import ToolTextInput from '@components/input/ToolTextInput ' ;
3
+ import ToolCodeInput from '@components/input/ToolCodeInput ' ;
4
4
import ToolTextResult from '@components/result/ToolTextResult' ;
5
5
import { beautifyJson } from './service' ;
6
6
import ToolInfo from '@components/ToolInfo' ;
@@ -130,10 +130,11 @@ export default function PrettifyJson({ title }: ToolComponentProps) {
130
130
title = { title }
131
131
input = { input }
132
132
inputComponent = {
133
- < ToolTextInput
133
+ < ToolCodeInput
134
134
title = { t ( 'prettify.inputTitle' ) }
135
135
value = { input }
136
136
onChange = { setInput }
137
+ language = "json"
137
138
/>
138
139
}
139
140
resultComponent = {
Original file line number Diff line number Diff line change 1
1
import { Box } from '@mui/material' ;
2
2
import React , { useState } from 'react' ;
3
3
import ToolContent from '@components/ToolContent' ;
4
- import ToolTextInput from '@components/input/ToolTextInput ' ;
4
+ import ToolCodeInput from '@components/input/ToolCodeInput ' ;
5
5
import ToolTextResult from '@components/result/ToolTextResult' ;
6
6
import { stringifyJson } from './service' ;
7
7
import { ToolComponentProps } from '@tools/defineTool' ;
@@ -103,10 +103,11 @@ export default function StringifyJson({ title }: ToolComponentProps) {
103
103
compute = { compute }
104
104
exampleCards = { exampleCards }
105
105
inputComponent = {
106
- < ToolTextInput
106
+ < ToolCodeInput
107
107
title = "JavaScript Object/Array"
108
108
value = { input }
109
109
onChange = { setInput }
110
+ language = "json"
110
111
/>
111
112
}
112
113
resultComponent = {
Original file line number Diff line number Diff line change 1
1
import React , { useState } from 'react' ;
2
2
import ToolContent from '@components/ToolContent' ;
3
- import ToolTextInput from '@components/input/ToolTextInput ' ;
3
+ import ToolCodeInput from '@components/input/ToolCodeInput ' ;
4
4
import ToolTextResult from '@components/result/ToolTextResult' ;
5
5
import { convertTsvToJson } from './service' ;
6
6
import { CardExampleType } from '@components/examples/ToolExamples' ;
@@ -216,7 +216,12 @@ export default function TsvToJson({
216
216
exampleCards = { exampleCards }
217
217
getGroups = { getGroups }
218
218
inputComponent = {
219
- < ToolTextInput title = "Input TSV" value = { input } onChange = { setInput } />
219
+ < ToolCodeInput
220
+ title = "Input TSV"
221
+ value = { input }
222
+ onChange = { setInput }
223
+ language = "tsv"
224
+ />
220
225
}
221
226
resultComponent = {
222
227
< ToolTextResult title = "Output JSON" value = { result } extension = { 'json' } />
Original file line number Diff line number Diff line change 1
1
import React , { useState } from 'react' ;
2
- import ToolTextInput from '@components/input/ToolTextInput ' ;
2
+ import ToolCodeInput from '@components/input/ToolCodeInput ' ;
3
3
import ToolTextResult from '@components/result/ToolTextResult' ;
4
4
import { CardExampleType } from '@components/examples/ToolExamples' ;
5
5
import { validateJson } from './service' ;
@@ -65,10 +65,11 @@ export default function ValidateJson({ title }: ToolComponentProps) {
65
65
< ToolContent
66
66
title = { title }
67
67
inputComponent = {
68
- < ToolTextInput
68
+ < ToolCodeInput
69
69
title = { t ( 'validateJson.inputTitle' ) }
70
70
value = { input }
71
71
onChange = { setInput }
72
+ language = "json"
72
73
/>
73
74
}
74
75
resultComponent = {
You can’t perform that action at this time.
0 commit comments