import { h, Component } from 'preact'; import { editorThemes } from '../editorThemes'; import Switch from './Switch'; import Tabs, { TabPanel } from './Tabs'; import { Divider } from './common'; function CheckboxSetting({ label, onChange, pref }) { return ( {label} ); } function HelpText({ children }) { return

{children}

; } export default class Settings extends Component { updateSetting(e, settingName) { const value = e.target.type === 'checkbox' ? e.target.checked : e.target.value; this.props.onChange(settingName, value); } shouldComponentUpdate() { // TODO: add check on prefs return true; } render() { const { prefs } = this.props; return (

Settings

this.updateSetting(e, 'preserveLastCode')} /> Loads the last open creation when app starts this.updateSetting(e, 'lightVersion')} /> Switch to lighter version for better performance. Removes things like blur etc. this.updateSetting(e, 'autoPreview')} /> Refreshes the preview as you code. Otherwise use the 'Run' button this.updateSetting(e, 'autoSave')} /> Auto-save keeps saving your code at regular intervals after you hit save manually the first time this.updateSetting(e, 'refreshOnResize')} /> Preview will refresh when you resize the preview pane
this.updateSetting(e, 'replaceNewTab')} showWhenExtension /> Turning this on will start showing Web Maker in every new tab you open
this.updateSetting(e, 'preserveConsoleLogs')} /> Preserves the console logs across your preview refreshes
this.updateSetting(e, 'isMonacoEditorOn')} /> (Experimental) Switches from CodeMirror to Monaco. Many other settings might not be available in Monaco.
Default Preprocessors
Key bindings
this.updateSetting(e, 'lineWrap')} /> this.updateSetting(e, 'autoCloseTags')} /> this.updateSetting(e, 'autoComplete')} />
this.updateSetting(e, 'isCodeBlastOn')} /> Enjoy wonderful particle blasts while you type this.updateSetting(e, 'isJs13kModeOn')} /> Make the app ready to build some games for{' '} Js13kGames .
Once you stop typing, the preview waits for this much time before getting updated. Too low value might choke your browser!
If any loop iteration takes more than the defined time, it is detected as a potential infinite loop and further iterations are stopped.
); } }