File tree Expand file tree Collapse file tree 4 files changed +186
-30
lines changed Expand file tree Collapse file tree 4 files changed +186
-30
lines changed Original file line number Diff line number Diff line change 63
63
"build" : " cross-env NODE_ENV=production webpack --config webpack.config.production.js" ,
64
64
"build-bin" : " electron-builder -mwl" ,
65
65
"test" : " cross-env NODE_ENV=test jest" ,
66
- "linter" : " eslint src"
66
+ "linter" : " eslint src" ,
67
+ "develop" : " concurrently \" yarn run dev\" \" yarn run electron\" "
67
68
},
68
69
"bin" : {
69
70
"reactype" : " ./index.js"
91
92
"cli-spinner" : " ^0.2.8" ,
92
93
"commander" : " ^2.17.1" ,
93
94
"d3" : " ^5.9.2" ,
94
- "enzyme" : " ^3.4.1" ,
95
95
"electron-reload" : " ^1.4.0" ,
96
+ "enzyme" : " ^3.4.1" ,
96
97
"konva" : " ^2.1.7" ,
97
98
"localforage" : " ^1.7.2" ,
98
99
"lodash.throttle" : " ^4.1.1" ,
105
106
"react-konva" : " ^1.7.12" ,
106
107
"react-redux" : " ^5.0.7" ,
107
108
"react-sortable-tree" : " ^2.2.0" ,
109
+ "react-syntax-highlighter" : " ^10.2.1" ,
108
110
"redux" : " ^4.0.0" ,
109
111
"redux-devtools-extension" : " ^2.13.5" ,
110
112
"redux-logger" : " ^3.0.6" ,
Original file line number Diff line number Diff line change @@ -26,4 +26,4 @@ export const ADD_PROP = 'ADD_PROP';
26
26
export const DELETE_ALL_DATA = 'DELETE_ALL_DATA' ;
27
27
export const CHANGE_IMAGE_PATH = 'CHANGE_IMAGE_PATH' ;
28
28
export const UPDATE_HTML_ATTR = 'UPDATE_HTML_ATTR' ;
29
- export const UPDATE_CHILDREN_SORT = 'UPDATE_CHILDREN_SORT' ;
29
+ export const UPDATE_CHILDREN_SORT = 'UPDATE_CHILDREN_SORT'
Original file line number Diff line number Diff line change 1
- import React , { Component , Fragment } from 'react' ;
1
+ import React , { Component } from 'react' ;
2
2
import { format } from 'prettier' ;
3
3
import componentRender from '../utils/componentRender.util.ts' ;
4
4
import { ComponentInt , ComponentsInt } from '../utils/Interfaces.ts' ;
5
5
/** ** SortCHildren will be fixed , dont XXX the file *** */
6
6
// import SortChildren from './SortChildren.jsx';
7
+ import SyntaxHighlighter from 'react-syntax-highlighter' ;
8
+ import { hybrid } from 'react-syntax-highlighter/dist/styles/hljs/' ;
7
9
8
10
type Props = {
9
11
focusComponent : ComponentInt ;
@@ -16,30 +18,17 @@ class CodePreview extends Component<Props> {
16
18
const components : ComponentsInt = this . props . components ;
17
19
18
20
return (
19
- < Fragment >
20
- { /* <SortChildren /> */ }
21
- < div
22
- style = { {
23
- width : '800px' ,
24
- height : '290px' ,
25
- direction : 'rtl' ,
26
- paddingLeft : '20px' ,
27
- color : '#D3D3D3' ,
28
- fontSize : 16 ,
29
- overflow : 'auto' ,
30
- } }
31
- >
32
- < pre style = { { direction : 'ltr' } } >
33
- { format ( componentRender ( focusComponent , components ) , {
34
- singleQuote : true ,
35
- trailingComma : 'es5' ,
36
- bracketSpacing : true ,
37
- jsxBracketSameLine : true ,
38
- parser : 'typescript' ,
39
- } ) }
40
- </ pre >
41
- </ div >
42
- </ Fragment >
21
+ < div
22
+ style = { {
23
+ height : '290px' ,
24
+ paddingLeft : '30px' ,
25
+ overflow : 'auto'
26
+ } }
27
+ >
28
+ < SyntaxHighlighter style = { hybrid } >
29
+ { format ( componentRender ( focusComponent , components ) ) }
30
+ </ SyntaxHighlighter >
31
+ </ div >
43
32
) ;
44
33
}
45
34
}
You can’t perform that action at this time.
0 commit comments