♻️ dry up <IDEView />
This commit is contained in:
parent
f9fdadbe52
commit
410ef1b9bb
1 changed files with 16 additions and 74 deletions
|
@ -344,46 +344,7 @@ class IDEView extends React.Component {
|
||||||
allowResize={this.props.ide.consoleIsExpanded}
|
allowResize={this.props.ide.consoleIsExpanded}
|
||||||
className="editor-preview-subpanel"
|
className="editor-preview-subpanel"
|
||||||
>
|
>
|
||||||
<Editor
|
<Editor provideController={(ctl) => { this.cmController = ctl; }} />
|
||||||
lintWarning={this.props.preferences.lintWarning}
|
|
||||||
linewrap={this.props.preferences.linewrap}
|
|
||||||
lintMessages={this.props.editorAccessibility.lintMessages}
|
|
||||||
updateLintMessage={this.props.updateLintMessage}
|
|
||||||
clearLintMessage={this.props.clearLintMessage}
|
|
||||||
file={this.props.selectedFile}
|
|
||||||
updateFileContent={this.props.updateFileContent}
|
|
||||||
fontSize={this.props.preferences.fontSize}
|
|
||||||
lineNumbers={this.props.preferences.lineNumbers}
|
|
||||||
files={this.props.files}
|
|
||||||
editorOptionsVisible={this.props.ide.editorOptionsVisible}
|
|
||||||
showEditorOptions={this.props.showEditorOptions}
|
|
||||||
closeEditorOptions={this.props.closeEditorOptions}
|
|
||||||
showKeyboardShortcutModal={
|
|
||||||
this.props.showKeyboardShortcutModal
|
|
||||||
}
|
|
||||||
setUnsavedChanges={this.props.setUnsavedChanges}
|
|
||||||
isPlaying={this.props.ide.isPlaying}
|
|
||||||
theme={this.props.preferences.theme}
|
|
||||||
startRefreshSketch={this.props.startRefreshSketch}
|
|
||||||
stopSketch={this.props.stopSketch}
|
|
||||||
autorefresh={this.props.preferences.autorefresh}
|
|
||||||
unsavedChanges={this.props.ide.unsavedChanges}
|
|
||||||
projectSavedTime={this.props.project.updatedAt}
|
|
||||||
isExpanded={this.props.ide.sidebarIsExpanded}
|
|
||||||
expandSidebar={this.props.expandSidebar}
|
|
||||||
collapseSidebar={this.props.collapseSidebar}
|
|
||||||
isUserOwner={isUserOwner(this.props)}
|
|
||||||
clearConsole={this.props.clearConsole}
|
|
||||||
consoleEvents={this.props.console}
|
|
||||||
showRuntimeErrorWarning={this.props.showRuntimeErrorWarning}
|
|
||||||
hideRuntimeErrorWarning={this.props.hideRuntimeErrorWarning}
|
|
||||||
runtimeErrorWarningVisible={
|
|
||||||
this.props.ide.runtimeErrorWarningVisible
|
|
||||||
}
|
|
||||||
provideController={(ctl) => {
|
|
||||||
this.cmController = ctl;
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<Console />
|
<Console />
|
||||||
</SplitPane>
|
</SplitPane>
|
||||||
<section className="preview-frame-holder">
|
<section className="preview-frame-holder">
|
||||||
|
@ -533,31 +494,25 @@ IDEView.propTypes = {
|
||||||
}).isRequired,
|
}).isRequired,
|
||||||
saveProject: PropTypes.func.isRequired,
|
saveProject: PropTypes.func.isRequired,
|
||||||
ide: PropTypes.shape({
|
ide: PropTypes.shape({
|
||||||
isPlaying: PropTypes.bool.isRequired,
|
errorType: PropTypes.string,
|
||||||
isAccessibleOutputPlaying: PropTypes.bool.isRequired,
|
keyboardShortcutVisible: PropTypes.bool.isRequired,
|
||||||
consoleEvent: PropTypes.array, // eslint-disable-line
|
|
||||||
modalIsVisible: PropTypes.bool.isRequired,
|
|
||||||
sidebarIsExpanded: PropTypes.bool.isRequired,
|
|
||||||
consoleIsExpanded: PropTypes.bool.isRequired,
|
|
||||||
preferencesIsVisible: PropTypes.bool.isRequired,
|
|
||||||
projectOptionsVisible: PropTypes.bool.isRequired,
|
|
||||||
newFolderModalVisible: PropTypes.bool.isRequired,
|
|
||||||
shareModalVisible: PropTypes.bool.isRequired,
|
shareModalVisible: PropTypes.bool.isRequired,
|
||||||
shareModalProjectId: PropTypes.string.isRequired,
|
shareModalProjectId: PropTypes.string.isRequired,
|
||||||
shareModalProjectName: PropTypes.string.isRequired,
|
shareModalProjectName: PropTypes.string.isRequired,
|
||||||
shareModalProjectUsername: PropTypes.string.isRequired,
|
shareModalProjectUsername: PropTypes.string.isRequired,
|
||||||
editorOptionsVisible: PropTypes.bool.isRequired,
|
|
||||||
keyboardShortcutVisible: PropTypes.bool.isRequired,
|
|
||||||
unsavedChanges: PropTypes.bool.isRequired,
|
|
||||||
infiniteLoop: PropTypes.bool.isRequired,
|
|
||||||
previewIsRefreshing: PropTypes.bool.isRequired,
|
|
||||||
infiniteLoopMessage: PropTypes.string.isRequired,
|
|
||||||
projectSavedTime: PropTypes.string,
|
|
||||||
previousPath: PropTypes.string.isRequired,
|
previousPath: PropTypes.string.isRequired,
|
||||||
justOpenedProject: PropTypes.bool.isRequired,
|
previewIsRefreshing: PropTypes.bool.isRequired,
|
||||||
errorType: PropTypes.string,
|
isPlaying: PropTypes.bool.isRequired,
|
||||||
runtimeErrorWarningVisible: PropTypes.bool.isRequired,
|
isAccessibleOutputPlaying: PropTypes.bool.isRequired,
|
||||||
|
projectOptionsVisible: PropTypes.bool.isRequired,
|
||||||
|
preferencesIsVisible: PropTypes.bool.isRequired,
|
||||||
|
modalIsVisible: PropTypes.bool.isRequired,
|
||||||
uploadFileModalVisible: PropTypes.bool.isRequired,
|
uploadFileModalVisible: PropTypes.bool.isRequired,
|
||||||
|
newFolderModalVisible: PropTypes.bool.isRequired,
|
||||||
|
justOpenedProject: PropTypes.bool.isRequired,
|
||||||
|
sidebarIsExpanded: PropTypes.bool.isRequired,
|
||||||
|
consoleIsExpanded: PropTypes.bool.isRequired,
|
||||||
|
unsavedChanges: PropTypes.bool.isRequired,
|
||||||
}).isRequired,
|
}).isRequired,
|
||||||
stopSketch: PropTypes.func.isRequired,
|
stopSketch: PropTypes.func.isRequired,
|
||||||
project: PropTypes.shape({
|
project: PropTypes.shape({
|
||||||
|
@ -572,11 +527,9 @@ IDEView.propTypes = {
|
||||||
editorAccessibility: PropTypes.shape({
|
editorAccessibility: PropTypes.shape({
|
||||||
lintMessages: PropTypes.array.isRequired, // eslint-disable-line
|
lintMessages: PropTypes.array.isRequired, // eslint-disable-line
|
||||||
}).isRequired,
|
}).isRequired,
|
||||||
updateLintMessage: PropTypes.func.isRequired,
|
|
||||||
clearLintMessage: PropTypes.func.isRequired,
|
|
||||||
preferences: PropTypes.shape({
|
preferences: PropTypes.shape({
|
||||||
fontSize: PropTypes.number.isRequired,
|
|
||||||
autosave: PropTypes.bool.isRequired,
|
autosave: PropTypes.bool.isRequired,
|
||||||
|
fontSize: PropTypes.number.isRequired,
|
||||||
linewrap: PropTypes.bool.isRequired,
|
linewrap: PropTypes.bool.isRequired,
|
||||||
lineNumbers: PropTypes.bool.isRequired,
|
lineNumbers: PropTypes.bool.isRequired,
|
||||||
lintWarning: PropTypes.bool.isRequired,
|
lintWarning: PropTypes.bool.isRequired,
|
||||||
|
@ -585,6 +538,7 @@ IDEView.propTypes = {
|
||||||
soundOutput: PropTypes.bool.isRequired,
|
soundOutput: PropTypes.bool.isRequired,
|
||||||
theme: PropTypes.string.isRequired,
|
theme: PropTypes.string.isRequired,
|
||||||
autorefresh: PropTypes.bool.isRequired,
|
autorefresh: PropTypes.bool.isRequired,
|
||||||
|
|
||||||
}).isRequired,
|
}).isRequired,
|
||||||
closePreferences: PropTypes.func.isRequired,
|
closePreferences: PropTypes.func.isRequired,
|
||||||
setFontSize: PropTypes.func.isRequired,
|
setFontSize: PropTypes.func.isRequired,
|
||||||
|
@ -601,7 +555,6 @@ IDEView.propTypes = {
|
||||||
name: PropTypes.string.isRequired,
|
name: PropTypes.string.isRequired,
|
||||||
content: PropTypes.string.isRequired,
|
content: PropTypes.string.isRequired,
|
||||||
})).isRequired,
|
})).isRequired,
|
||||||
updateFileContent: PropTypes.func.isRequired,
|
|
||||||
selectedFile: PropTypes.shape({
|
selectedFile: PropTypes.shape({
|
||||||
id: PropTypes.string.isRequired,
|
id: PropTypes.string.isRequired,
|
||||||
content: PropTypes.string.isRequired,
|
content: PropTypes.string.isRequired,
|
||||||
|
@ -629,9 +582,6 @@ IDEView.propTypes = {
|
||||||
closeNewFileModal: PropTypes.func.isRequired,
|
closeNewFileModal: PropTypes.func.isRequired,
|
||||||
createFolder: PropTypes.func.isRequired,
|
createFolder: PropTypes.func.isRequired,
|
||||||
closeShareModal: PropTypes.func.isRequired,
|
closeShareModal: PropTypes.func.isRequired,
|
||||||
showEditorOptions: PropTypes.func.isRequired,
|
|
||||||
closeEditorOptions: PropTypes.func.isRequired,
|
|
||||||
showKeyboardShortcutModal: PropTypes.func.isRequired,
|
|
||||||
closeKeyboardShortcutModal: PropTypes.func.isRequired,
|
closeKeyboardShortcutModal: PropTypes.func.isRequired,
|
||||||
toast: PropTypes.shape({
|
toast: PropTypes.shape({
|
||||||
isVisible: PropTypes.bool.isRequired,
|
isVisible: PropTypes.bool.isRequired,
|
||||||
|
@ -641,22 +591,14 @@ IDEView.propTypes = {
|
||||||
setRouteLeaveHook: PropTypes.func,
|
setRouteLeaveHook: PropTypes.func,
|
||||||
}).isRequired,
|
}).isRequired,
|
||||||
route: PropTypes.oneOfType([PropTypes.object, PropTypes.element]).isRequired,
|
route: PropTypes.oneOfType([PropTypes.object, PropTypes.element]).isRequired,
|
||||||
setUnsavedChanges: PropTypes.func.isRequired,
|
|
||||||
setTheme: PropTypes.func.isRequired,
|
setTheme: PropTypes.func.isRequired,
|
||||||
endSketchRefresh: PropTypes.func.isRequired,
|
endSketchRefresh: PropTypes.func.isRequired,
|
||||||
startRefreshSketch: PropTypes.func.isRequired,
|
|
||||||
setBlobUrl: PropTypes.func.isRequired,
|
setBlobUrl: PropTypes.func.isRequired,
|
||||||
setPreviousPath: PropTypes.func.isRequired,
|
setPreviousPath: PropTypes.func.isRequired,
|
||||||
console: PropTypes.arrayOf(PropTypes.shape({
|
|
||||||
method: PropTypes.string.isRequired,
|
|
||||||
args: PropTypes.arrayOf(PropTypes.string),
|
|
||||||
})).isRequired,
|
|
||||||
clearConsole: PropTypes.func.isRequired,
|
clearConsole: PropTypes.func.isRequired,
|
||||||
showErrorModal: PropTypes.func.isRequired,
|
showErrorModal: PropTypes.func.isRequired,
|
||||||
hideErrorModal: PropTypes.func.isRequired,
|
hideErrorModal: PropTypes.func.isRequired,
|
||||||
clearPersistedState: PropTypes.func.isRequired,
|
clearPersistedState: PropTypes.func.isRequired,
|
||||||
showRuntimeErrorWarning: PropTypes.func.isRequired,
|
|
||||||
hideRuntimeErrorWarning: PropTypes.func.isRequired,
|
|
||||||
startSketch: PropTypes.func.isRequired,
|
startSketch: PropTypes.func.isRequired,
|
||||||
openUploadFileModal: PropTypes.func.isRequired,
|
openUploadFileModal: PropTypes.func.isRequired,
|
||||||
closeUploadFileModal: PropTypes.func.isRequired,
|
closeUploadFileModal: PropTypes.func.isRequired,
|
||||||
|
|
Loading…
Reference in a new issue