Complete main UI #37
@@ -1,43 +1,98 @@
|
|||||||
.monaco-editor-light {
|
@mixin keyframes($animationName) {
|
||||||
height: 100%;
|
@-webkit-keyframes #{$animationName} {
|
||||||
overflow: hidden;
|
@content
|
||||||
background-color: var(--border);
|
|
||||||
|
|
||||||
.jsx-tag-angle-bracket {
|
|
||||||
color: #800000;
|
|
||||||
}
|
}
|
||||||
|
@-moz-keyframes #{$animationName} {
|
||||||
.jsx-text {
|
@content
|
||||||
color: #000;
|
|
||||||
}
|
}
|
||||||
|
@-o-keyframes #{$animationName} {
|
||||||
.jsx-tag-name {
|
@content
|
||||||
color: #800000;
|
|
||||||
}
|
}
|
||||||
|
@keyframes #{$animationName} {
|
||||||
.jsx-tag-attribute-key {
|
@content
|
||||||
color: #f00;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.monaco-editor-vs-dark {
|
@mixin unique-keyframes {
|
||||||
height: 100%;
|
$animationName: unique-id();
|
||||||
overflow: hidden;
|
animation-name: $animationName;
|
||||||
background-color: var(--border);
|
@include keyframes($animationName) {
|
||||||
|
@content
|
||||||
.jsx-tag-angle-bracket {
|
}
|
||||||
color: #808080;
|
}
|
||||||
}
|
|
||||||
|
[data-component=playground-code-editor-editor] {
|
||||||
.jsx-text {
|
position: relative;
|
||||||
color: #d4d4d4;
|
height: 0;
|
||||||
}
|
|
||||||
|
.monaco-editor-light {
|
||||||
.jsx-tag-name {
|
height: 100%;
|
||||||
color: #569cd6;
|
overflow: hidden;
|
||||||
}
|
background-color: var(--border);
|
||||||
|
|
||||||
.jsx-tag-attribute-key {
|
.jsx-tag-angle-bracket {
|
||||||
color: #9cdcfe;
|
color: #800000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.jsx-text {
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.jsx-tag-name {
|
||||||
|
color: #800000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.jsx-tag-attribute-key {
|
||||||
|
color: #f00;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.monaco-editor-vs-dark {
|
||||||
|
height: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
background-color: var(--border);
|
||||||
|
|
||||||
|
.jsx-tag-angle-bracket {
|
||||||
|
color: #808080;
|
||||||
|
}
|
||||||
|
|
||||||
|
.jsx-text {
|
||||||
|
color: #d4d4d4;
|
||||||
|
}
|
||||||
|
|
||||||
|
.jsx-tag-name {
|
||||||
|
color: #569cd6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.jsx-tag-attribute-key {
|
||||||
|
color: #9cdcfe;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.playground-code-editor-loading {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
margin: 4px;
|
||||||
|
width: 10px;
|
||||||
|
height: 10px;
|
||||||
|
border-radius: 50%;
|
||||||
|
border: {
|
||||||
|
top: 2px #666 solid;
|
||||||
|
bottom: 2px #ddd solid;
|
||||||
|
left: 2px #ddd solid;
|
||||||
|
right: 2px #ddd solid;
|
||||||
|
};
|
||||||
|
animation: .6s linear infinite;
|
||||||
|
|
||||||
|
@include unique-keyframes {
|
||||||
|
0% {
|
||||||
|
transform: rotateZ(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
100% {
|
||||||
|
transform: rotateZ(360deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -36,7 +36,7 @@ const Editor: React.FC<EditorProps> = ({
|
|||||||
highlighter: () => undefined,
|
highlighter: () => undefined,
|
||||||
dispose: () => undefined
|
dispose: () => undefined
|
||||||
})
|
})
|
||||||
const { onWatch } = useTypesProgress()
|
const { total, finished, onWatch } = useTypesProgress()
|
||||||
const file = files[selectedFileName] ?? { name: 'Untitled' }
|
const file = files[selectedFileName] ?? { name: 'Untitled' }
|
||||||
|
|
||||||
const handleOnEditorDidMount = (editor: editor.IStandaloneCodeEditor, monaco: Monaco) => {
|
const handleOnEditorDidMount = (editor: editor.IStandaloneCodeEditor, monaco: Monaco) => {
|
||||||
@@ -87,21 +87,24 @@ const Editor: React.FC<EditorProps> = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<MonacoEditor
|
<div data-component={'playground-code-editor-editor'}>
|
||||||
theme={theme}
|
<MonacoEditor
|
||||||
path={file.name}
|
theme={theme}
|
||||||
className={`monaco-editor-${theme ?? 'light'}`}
|
path={file.name}
|
||||||
language={file.language}
|
className={`monaco-editor-${theme ?? 'light'}`}
|
||||||
value={file.value}
|
language={file.language}
|
||||||
onChange={onChange}
|
value={file.value}
|
||||||
onMount={handleOnEditorDidMount}
|
onChange={onChange}
|
||||||
options={{
|
onMount={handleOnEditorDidMount}
|
||||||
...MonacoEditorConfig,
|
options={{
|
||||||
...options,
|
...MonacoEditorConfig,
|
||||||
theme: undefined,
|
...options,
|
||||||
readOnly: readonly
|
theme: undefined,
|
||||||
}}
|
readOnly: readonly
|
||||||
/>
|
}}
|
||||||
|
/>
|
||||||
|
{total > 0 && !finished && <div className={'playground-code-editor-loading'} />}
|
||||||
|
</div>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
import React from 'react'
|
import React from 'react'
|
||||||
import { IPlayground } from '@/components/Playground/shared'
|
|
||||||
|
|
||||||
const ReactPlayground: React.FC<IPlayground> = () => {
|
const ReactPlayground: React.FC = () => {
|
||||||
return <></>
|
return <></>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user