mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-27 21:48:27 +00:00
prettier
This commit is contained in:
parent
5e6131af24
commit
25d61a2e31
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
import Loader from '@src/repl/components/Loader';
|
import Loader from '@src/repl/components/Loader';
|
||||||
import { Panel } from '@src/repl/components/panel/Panel';
|
import { Panel } from '@src/repl/components/panel/Panel';
|
||||||
import { Code } from '@src/repl/components/Code';
|
import { Code } from '@src/repl/components/Code';
|
||||||
@ -10,18 +9,18 @@ import UserFacingErrorMessage from '@src/repl/components/UserFacingErrorMessage'
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
export default function UdelsEditor(Props) {
|
export default function UdelsEditor(Props) {
|
||||||
const {context} = Props;
|
const { context } = Props;
|
||||||
const { containerRef, editorRef, error, init, pending, started, handleTogglePlay } = context;
|
const { containerRef, editorRef, error, init, pending, started, handleTogglePlay } = context;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={'h-full flex w-full flex-col relative'}>
|
<div className={'h-full flex w-full flex-col relative'}>
|
||||||
<Loader active={pending} />
|
<Loader active={pending} />
|
||||||
<BigPlayButton started={started} handleTogglePlay={handleTogglePlay} />
|
<BigPlayButton started={started} handleTogglePlay={handleTogglePlay} />
|
||||||
<div className="grow flex relative overflow-hidden">
|
<div className="grow flex relative overflow-hidden">
|
||||||
<Code containerRef={containerRef} editorRef={editorRef} init={init} />
|
<Code containerRef={containerRef} editorRef={editorRef} init={init} />
|
||||||
</div>
|
|
||||||
<UserFacingErrorMessage error={error} />
|
|
||||||
<Panel context={context} />
|
|
||||||
</div>
|
</div>
|
||||||
|
<UserFacingErrorMessage error={error} />
|
||||||
|
<Panel context={context} />
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,9 +5,7 @@ This program is free software: you can redistribute it and/or modify it under th
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { isIframe, isUdels } from './util.mjs';
|
import { isIframe, isUdels } from './util.mjs';
|
||||||
|
|
||||||
import UdelsEditor from '@components/Udels/UdelsEditor';
|
import UdelsEditor from '@components/Udels/UdelsEditor';
|
||||||
|
|
||||||
import ReplEditor from './components/ReplEditor';
|
import ReplEditor from './components/ReplEditor';
|
||||||
import EmbeddedReplEditor from './components/EmbeddedReplEditor';
|
import EmbeddedReplEditor from './components/EmbeddedReplEditor';
|
||||||
import { useReplContext } from './useReplContext';
|
import { useReplContext } from './useReplContext';
|
||||||
|
|||||||
@ -6,23 +6,14 @@ import SparklesIcon from '@heroicons/react/20/solid/SparklesIcon';
|
|||||||
import StopCircleIcon from '@heroicons/react/20/solid/StopCircleIcon';
|
import StopCircleIcon from '@heroicons/react/20/solid/StopCircleIcon';
|
||||||
import cx from '@src/cx.mjs';
|
import cx from '@src/cx.mjs';
|
||||||
import { useSettings, setIsZen } from '../../settings.mjs';
|
import { useSettings, setIsZen } from '../../settings.mjs';
|
||||||
|
|
||||||
import '../Repl.css';
|
import '../Repl.css';
|
||||||
|
|
||||||
const { BASE_URL } = import.meta.env;
|
const { BASE_URL } = import.meta.env;
|
||||||
const baseNoTrailing = BASE_URL.endsWith('/') ? BASE_URL.slice(0, -1) : BASE_URL;
|
const baseNoTrailing = BASE_URL.endsWith('/') ? BASE_URL.slice(0, -1) : BASE_URL;
|
||||||
|
|
||||||
export function Header({ context, embedded = false }) {
|
export function Header({ context, embedded = false }) {
|
||||||
const {
|
const { started, pending, isDirty, activeCode, handleTogglePlay, handleEvaluate, handleShuffle, handleShare } =
|
||||||
|
context;
|
||||||
started,
|
|
||||||
pending,
|
|
||||||
isDirty,
|
|
||||||
activeCode,
|
|
||||||
handleTogglePlay,
|
|
||||||
handleEvaluate,
|
|
||||||
handleShuffle,
|
|
||||||
handleShare,
|
|
||||||
} = context;
|
|
||||||
const isEmbedded = typeof window !== 'undefined' && (embedded || window.location !== window.parent.location);
|
const isEmbedded = typeof window !== 'undefined' && (embedded || window.location !== window.parent.location);
|
||||||
const { isZen } = useSettings();
|
const { isZen } = useSettings();
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
import Loader from '@src/repl/components/Loader';
|
import Loader from '@src/repl/components/Loader';
|
||||||
import { Panel } from '@src/repl/components/panel/Panel';
|
import { Panel } from '@src/repl/components/panel/Panel';
|
||||||
import { Code } from '@src/repl/components/Code';
|
import { Code } from '@src/repl/components/Code';
|
||||||
@ -11,11 +10,10 @@ import { useSettings } from '@src/settings.mjs';
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
export default function ReplEditor(Props) {
|
export default function ReplEditor(Props) {
|
||||||
const {context} = Props;
|
const { context } = Props;
|
||||||
const { containerRef, editorRef, error, init, pending } = context;
|
const { containerRef, editorRef, error, init, pending } = context;
|
||||||
const settings = useSettings()
|
const settings = useSettings();
|
||||||
const {panelPosition} = settings;
|
const { panelPosition } = settings;
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="h-full flex flex-col relative">
|
<div className="h-full flex flex-col relative">
|
||||||
|
|||||||
@ -30,13 +30,12 @@ import {
|
|||||||
} from '../user_pattern_utils.mjs';
|
} from '../user_pattern_utils.mjs';
|
||||||
import { useStore } from '@nanostores/react';
|
import { useStore } from '@nanostores/react';
|
||||||
import { prebake } from './prebake.mjs';
|
import { prebake } from './prebake.mjs';
|
||||||
import { getRandomTune, initCode, loadModules, shareCode, } from './util.mjs';
|
import { getRandomTune, initCode, loadModules, shareCode } from './util.mjs';
|
||||||
import './Repl.css';
|
import './Repl.css';
|
||||||
import { setInterval, clearInterval } from 'worker-timers';
|
import { setInterval, clearInterval } from 'worker-timers';
|
||||||
import { getMetadata } from '../metadata_parser';
|
import { getMetadata } from '../metadata_parser';
|
||||||
|
|
||||||
const { latestCode } = settingsMap.get();
|
const { latestCode } = settingsMap.get();
|
||||||
|
|
||||||
let modulesLoading, presets, drawContext, clearCanvas, audioReady;
|
let modulesLoading, presets, drawContext, clearCanvas, audioReady;
|
||||||
|
|
||||||
if (typeof window !== 'undefined') {
|
if (typeof window !== 'undefined') {
|
||||||
@ -116,7 +115,6 @@ export function useReplContext() {
|
|||||||
window.strudelMirror = editor;
|
window.strudelMirror = editor;
|
||||||
|
|
||||||
// init settings
|
// init settings
|
||||||
|
|
||||||
initCode().then(async (decoded) => {
|
initCode().then(async (decoded) => {
|
||||||
let code, msg;
|
let code, msg;
|
||||||
if (decoded) {
|
if (decoded) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user