This repository was archived by the owner on Apr 8, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +68
-1
lines changed Expand file tree Collapse file tree 6 files changed +68
-1
lines changed Original file line number Diff line number Diff line change 1+ "use strict" ;
2+ var __extends = ( this && this . __extends ) || function ( d , b ) {
3+ for ( var p in b ) if ( b . hasOwnProperty ( p ) ) d [ p ] = b [ p ] ;
4+ function __ ( ) { this . constructor = d ; }
5+ d . prototype = b === null ? Object . create ( b ) : ( __ . prototype = b . prototype , new __ ( ) ) ;
6+ } ;
7+ var React = require ( 'react' ) ;
8+ var styles = {
9+ editor : {
10+ textAlign : 'left' ,
11+ border : '2px solid red' ,
12+ margin : '5px' ,
13+ borderRadius : '3px' ,
14+ } ,
15+ } ;
16+ var TextEditor = ( function ( _super ) {
17+ __extends ( TextEditor , _super ) ;
18+ function TextEditor ( ) {
19+ _super . apply ( this , arguments ) ;
20+ }
21+ TextEditor . prototype . componentDidMount = function ( ) {
22+ var ed = atom . workspace . buildTextEditor ( ) ;
23+ ed . setGrammar ( atom . grammars . grammarForScopeName ( 'source.js' ) ) ;
24+ console . log ( ed ) ;
25+ ed . setText ( 'var a = 42;' ) ;
26+ document . querySelector ( "#" + this . props . name ) . appendChild ( ed . getElement ( ) ) ;
27+ } ;
28+ TextEditor . prototype . render = function ( ) {
29+ return React . createElement ( "div" , { id : this . props . name , style : styles . editor } ) ;
30+ } ;
31+ return TextEditor ;
32+ } ( React . Component ) ) ;
33+ Object . defineProperty ( exports , "__esModule" , { value : true } ) ;
34+ exports . default = TextEditor ;
Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ var Start_1 = require('./Start');
1616exports . Start = Start_1 . default ;
1717var Tutorials_1 = require ( './Tutorials' ) ;
1818exports . Tutorials = Tutorials_1 . default ;
19+ var TextEditor_1 = require ( './TextEditor' ) ;
20+ exports . TextEditor = TextEditor_1 . default ;
1921var RouteButton_1 = require ( './common/RouteButton' ) ;
2022exports . RouteButton = RouteButton_1 . default ;
2123var ContentCard_1 = require ( './common/ContentCard' ) ;
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ export default class Start extends React.Component<{
1818} , { } > {
1919 render ( ) {
2020 const { ready} = this . props ;
21+
2122 return (
2223 < section className = 'cr-start' >
2324 < div style = { headerStyles } >
Original file line number Diff line number Diff line change 1+ import * as React from 'react' ;
2+
3+ const styles = {
4+ editor : {
5+ textAlign : 'left' ,
6+ border : '2px solid red' ,
7+ margin : '5px' ,
8+ borderRadius : '3px' ,
9+ } ,
10+ } ;
11+
12+ export default class TextEditor extends React . Component < {
13+ name : string
14+ } , { } > {
15+ componentDidMount ( ) {
16+ const ed = atom . workspace . buildTextEditor ( ) ;
17+ ed . setGrammar (
18+ atom . grammars . grammarForScopeName ( 'source.js' )
19+ ) ;
20+ console . log ( ed ) ;
21+ // ed.style.textAlign = 'left';
22+ ed . setText ( 'var a = 42;' ) ;
23+ document . querySelector ( `#${ this . props . name } ` ) . appendChild ( ed . getElement ( ) ) ;
24+ }
25+ render ( ) {
26+ return < div id = { this . props . name } style = { styles . editor } /> ;
27+ }
28+ }
Original file line number Diff line number Diff line change 11export {
2- Alert , Markdown
2+ Alert , Markdown
33} from 'core-coderoad' ;
44
55export { default as AppMenu } from './AppMenu' ;
@@ -9,6 +9,7 @@ export {default as Progress} from './Progress';
99export { default as Routes } from './Routes' ;
1010export { default as Start } from './Start' ;
1111export { default as Tutorials } from './Tutorials' ;
12+ export { default as TextEditor } from './TextEditor' ;
1213
1314export { default as RouteButton } from './common/RouteButton' ;
1415export { default as ContentCard } from './common/ContentCard' ;
Original file line number Diff line number Diff line change 120120 " src/components/Start/Checks/VerifyButton.tsx" ,
121121 " src/components/Start/index.tsx" ,
122122 " src/components/Start/Welcome/index.tsx" ,
123+ " src/components/TextEditor/index.tsx" ,
123124 " src/components/Tutorials/index.tsx" ,
124125 " src/components/Tutorials/LoadTutorials/index.tsx" ,
125126 " src/components/Tutorials/SelectTutorial/index.tsx" ,
You can’t perform that action at this time.
0 commit comments