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 6363 "build" : " cross-env NODE_ENV=production webpack --config webpack.config.production.js" ,
6464 "build-bin" : " electron-builder -mwl" ,
6565 "test" : " cross-env NODE_ENV=test jest" ,
66- "linter" : " eslint src"
66+ "linter" : " eslint src" ,
67+ "develop" : " concurrently \" yarn run dev\" \" yarn run electron\" "
6768 },
6869 "bin" : {
6970 "reactype" : " ./index.js"
9192 "cli-spinner" : " ^0.2.8" ,
9293 "commander" : " ^2.17.1" ,
9394 "d3" : " ^5.9.2" ,
94- "enzyme" : " ^3.4.1" ,
9595 "electron-reload" : " ^1.4.0" ,
96+ "enzyme" : " ^3.4.1" ,
9697 "konva" : " ^2.1.7" ,
9798 "localforage" : " ^1.7.2" ,
9899 "lodash.throttle" : " ^4.1.1" ,
105106 "react-konva" : " ^1.7.12" ,
106107 "react-redux" : " ^5.0.7" ,
107108 "react-sortable-tree" : " ^2.2.0" ,
109+ "react-syntax-highlighter" : " ^10.2.1" ,
108110 "redux" : " ^4.0.0" ,
109111 "redux-devtools-extension" : " ^2.13.5" ,
110112 "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';
2626export const DELETE_ALL_DATA = 'DELETE_ALL_DATA' ;
2727export const CHANGE_IMAGE_PATH = 'CHANGE_IMAGE_PATH' ;
2828export 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' ;
22import { format } from 'prettier' ;
33import componentRender from '../utils/componentRender.util.ts' ;
44import { ComponentInt , ComponentsInt } from '../utils/Interfaces.ts' ;
55/** ** SortCHildren will be fixed , dont XXX the file *** */
66// import SortChildren from './SortChildren.jsx';
7+ import SyntaxHighlighter from 'react-syntax-highlighter' ;
8+ import { hybrid } from 'react-syntax-highlighter/dist/styles/hljs/' ;
79
810type Props = {
911 focusComponent : ComponentInt ;
@@ -16,30 +18,17 @@ class CodePreview extends Component<Props> {
1618 const components : ComponentsInt = this . props . components ;
1719
1820 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 >
4332 ) ;
4433 }
4534}
You can’t perform that action at this time.
0 commit comments