MCPcopy Create free account
hub / github.com/SplootCode/splootcode / render

Method render

packages/editor/src/components/editor.tsx:51–102  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

49 }
50
51 render() {
52 const { block, selection, banner } = this.props
53 let fileBody = null
54
55 fileBody = block.renderedChildSets['body']
56
57 const height = block.rowHeight + block.indentedBlockHeight
58 let insertBox = null
59 let editBox = null
60 if (selection.isCursor() && selection.insertBox !== null) {
61 insertBox = (
62 <InsertBox
63 hidden={selection.isHidden}
64 editorX={0}
65 editorY={0}
66 selection={selection}
67 cursorPosition={selection.cursor}
68 insertBoxData={selection.insertBox}
69 />
70 )
71 } else if (selection.isEditingSingleNode()) {
72 editBox = <EditBox editorX={1} editorY={1} selection={selection} editBoxData={selection.editBox} />
73 }
74 return (
75 <React.Fragment>
76 <div className="editor-column">
77 {banner}
78 <div
79 className="editor-box"
80 ref={this.editorColumnRef}
81 onBlur={this.onBlurHandler}
82 onFocus={this.onFocusHandler}
83 >
84 <svg
85 className="editor-svg"
86 xmlns="http://www.w3.org/2000/svg"
87 height={height}
88 preserveAspectRatio="none"
89 onClick={this.onClickHandler}
90 ref={this.editorSvgRef}
91 >
92 <ExpandedListBlockView block={fileBody} isSelected={false} />
93 <ActiveCursor selection={selection} />
94 </svg>
95 {insertBox}
96 {editBox}
97 </div>
98 </div>
99 <DragOverlay selection={selection} editorRef={this.editorSvgRef} />
100 </React.Fragment>
101 )
102 }
103
104 onClickHandler = (event: React.MouseEvent) => {
105 const selection = this.props.selection

Callers

nothing calls this directly

Calls 2

isCursorMethod · 0.80
isEditingSingleNodeMethod · 0.80

Tested by

no test coverage detected