|
|
@ -1,6 +1,5 @@
|
|
|
|
import React, { PureComponent } from 'react'
|
|
|
|
import React, { PureComponent } from 'react'
|
|
|
|
import * as hljs from 'highlight.js'
|
|
|
|
import * as hljs from 'highlight.js'
|
|
|
|
import Spinner from 'react-spinner'
|
|
|
|
|
|
|
|
import ResizeObserver from 'resize-observer-polyfill'
|
|
|
|
import ResizeObserver from 'resize-observer-polyfill'
|
|
|
|
import debounce from 'lodash.debounce'
|
|
|
|
import debounce from 'lodash.debounce'
|
|
|
|
import ms from 'ms'
|
|
|
|
import ms from 'ms'
|
|
|
@ -29,7 +28,6 @@ class Carbon extends PureComponent {
|
|
|
|
super(props)
|
|
|
|
super(props)
|
|
|
|
|
|
|
|
|
|
|
|
this.state = {
|
|
|
|
this.state = {
|
|
|
|
loading: true,
|
|
|
|
|
|
|
|
language: props.config.language
|
|
|
|
language: props.config.language
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -40,10 +38,6 @@ class Carbon extends PureComponent {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
componentDidMount() {
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
loading: false
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.setState(handleLanguageChange(this.props.children, this.props))
|
|
|
|
this.setState(handleLanguageChange(this.props.children, this.props))
|
|
|
|
|
|
|
|
|
|
|
|
const ro = new ResizeObserver(entries => {
|
|
|
|
const ro = new ResizeObserver(entries => {
|
|
|
@ -93,21 +87,7 @@ class Carbon extends PureComponent {
|
|
|
|
(this.props.config.backgroundImage && this.props.config.backgroundImageSelection) ||
|
|
|
|
(this.props.config.backgroundImage && this.props.config.backgroundImageSelection) ||
|
|
|
|
this.props.config.backgroundImage
|
|
|
|
this.props.config.backgroundImage
|
|
|
|
|
|
|
|
|
|
|
|
// set content to spinner if loading, else editor
|
|
|
|
const content = (
|
|
|
|
let content = (
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
|
|
|
<Spinner />
|
|
|
|
|
|
|
|
<style jsx>
|
|
|
|
|
|
|
|
{`
|
|
|
|
|
|
|
|
div {
|
|
|
|
|
|
|
|
height: 352px;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
`}
|
|
|
|
|
|
|
|
</style>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
if (this.state.loading === false) {
|
|
|
|
|
|
|
|
content = (
|
|
|
|
|
|
|
|
<div id="container">
|
|
|
|
<div id="container">
|
|
|
|
{config.windowControls ? (
|
|
|
|
{config.windowControls ? (
|
|
|
|
<WindowControls
|
|
|
|
<WindowControls
|
|
|
@ -246,7 +226,6 @@ class Carbon extends PureComponent {
|
|
|
|
</style>
|
|
|
|
</style>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div id="section">
|
|
|
|
<div id="section">
|
|
|
|