|
|
@ -42,7 +42,7 @@ const SnippetToolbar = dynamic(() => import('./SnippetToolbar'), {
|
|
|
|
loading: () => null,
|
|
|
|
loading: () => null,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
const getConfig = omit(['code'])
|
|
|
|
const getConfig = omit(['code', 'titleBar'])
|
|
|
|
const unsplashPhotographerCredit = /\n\n\/\/ Photo by.+?on Unsplash/
|
|
|
|
const unsplashPhotographerCredit = /\n\n\/\/ Photo by.+?on Unsplash/
|
|
|
|
|
|
|
|
|
|
|
|
class Editor extends React.Component {
|
|
|
|
class Editor extends React.Component {
|
|
|
@ -91,6 +91,7 @@ class Editor extends React.Component {
|
|
|
|
updateState = updates => this.setState(updates, () => this.onUpdate(this.state))
|
|
|
|
updateState = updates => this.setState(updates, () => this.onUpdate(this.state))
|
|
|
|
|
|
|
|
|
|
|
|
updateCode = code => this.updateState({ code })
|
|
|
|
updateCode = code => this.updateState({ code })
|
|
|
|
|
|
|
|
updateTitleBar = titleBar => this.updateState({ titleBar })
|
|
|
|
updateWidth = width => this.setState({ widthAdjustment: false, width })
|
|
|
|
updateWidth = width => this.setState({ widthAdjustment: false, width })
|
|
|
|
|
|
|
|
|
|
|
|
getCarbonImage = async (
|
|
|
|
getCarbonImage = async (
|
|
|
@ -322,6 +323,7 @@ class Editor extends React.Component {
|
|
|
|
backgroundMode,
|
|
|
|
backgroundMode,
|
|
|
|
code,
|
|
|
|
code,
|
|
|
|
exportSize,
|
|
|
|
exportSize,
|
|
|
|
|
|
|
|
titleBar,
|
|
|
|
} = this.state
|
|
|
|
} = this.state
|
|
|
|
|
|
|
|
|
|
|
|
const config = getConfig(this.state)
|
|
|
|
const config = getConfig(this.state)
|
|
|
@ -399,6 +401,8 @@ class Editor extends React.Component {
|
|
|
|
updateWidth={this.updateWidth}
|
|
|
|
updateWidth={this.updateWidth}
|
|
|
|
loading={this.state.loading}
|
|
|
|
loading={this.state.loading}
|
|
|
|
theme={theme}
|
|
|
|
theme={theme}
|
|
|
|
|
|
|
|
titleBar={titleBar}
|
|
|
|
|
|
|
|
onTitleBarChange={this.updateTitleBar}
|
|
|
|
>
|
|
|
|
>
|
|
|
|
{code != null ? code : DEFAULT_CODE}
|
|
|
|
{code != null ? code : DEFAULT_CODE}
|
|
|
|
</Carbon>
|
|
|
|
</Carbon>
|
|
|
|