Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
},
"dependencies": {
"@icons-pack/react-simple-icons": "^9.4.1",
"@monaco-editor/react": "^4.6.0",
"@uidotdev/usehooks": "^2.4.1",
"client-only": "^0.0.1",
"clsx": "^2.1.0",
Expand All @@ -21,7 +22,6 @@
"react": "^18",
"react-dom": "^18",
"server-only": "^0.0.1",
"shiki": "^1.3.0",
"tailwind-merge": "^2.3.0"
},
"devDependencies": {
Expand Down
46 changes: 33 additions & 13 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 0 additions & 36 deletions src/app/globals.css
Original file line number Diff line number Diff line change
@@ -1,39 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

html .shiki {
background-color: transparent !important;
}

html .shiki,
html .shiki > * {
font-family: inherit;
}

html .shiki .line {
counter-increment: line-numbering;
}

html .shiki .line::before {
content: counter(line-numbering);
display: inline-block;
width: 2em;
margin-right: 1em;
color: var(--shiki-line-number-color);
text-align: right;
user-select: none;

@apply text-neutral-400;
}

@media (prefers-color-scheme: dark) {
html .shiki,
html .shiki span {
color: var(--shiki-dark) !important;
/* Optional, if you also want font styles */
font-style: var(--shiki-dark-font-style) !important;
font-weight: var(--shiki-dark-font-weight) !important;
text-decoration: var(--shiki-dark-text-decoration) !important;
}
}
8 changes: 3 additions & 5 deletions src/app/inner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import { Header } from "@/lib/ui/header";
import { TabSelector } from "@/lib/ui/tabs/selector";
import { TabController } from "@/lib/ui/tabs/controller";
import { useBreakpoint } from "@/lib/ui/tailwindcss/client/hooks/breakpoint";
import { Highlight } from "@/lib/ui/highlight";
import { cn } from "@/lib/ui/utils/cn";
import { TabContent } from "@/lib/ui/tabs/content";
import { OutputTabContents } from "@/lib/ui/protocol/OutputTabContents";
import { OutputTabSelectors } from "@/lib/ui/protocol/OutputTabSelectors";
import { OutputTabController } from "@/lib/ui/protocol/OutputTabController";
import { CompilerProvider } from "@/lib/hooks/compiler";
import CodeEditor from "@/lib/ui/editor/codeEditor";
import { TabContent } from "@/lib/ui/tabs/content";

const defaultCode = `// Insert your code here

Expand Down Expand Up @@ -64,9 +64,7 @@ export function Inner({ initialCode }: { initialCode: string | null }) {
</nav>
</div>
<TabContent name="input">
<div className="overflow-x-auto bg-neutral-100 outline-2 -outline-offset-2 outline-teal-500 focus-visible:outline dark:bg-neutral-900 dark:outline-teal-300">
<Highlight />
</div>
<CodeEditor initialCode={initialCode ?? defaultCode}/>
</TabContent>
{!lg.loading && !lg.active && <OutputTabContents />}
</section>
Expand Down
24 changes: 24 additions & 0 deletions src/lib/ui/editor/codeEditor.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { useCompilerContext } from "@/lib/hooks/compiler"
import { Editor } from "@monaco-editor/react"


export type CodeEditorProps = {
initialCode: string
}

export default function CodeEditor({initialCode}: CodeEditorProps){
const compilerContext = useCompilerContext()

return (
<>
<Editor
language="java"
defaultValue={initialCode}
theme={window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches ? 'vs-dark' : 'light'}
onChange={ (value) => {
if (value != undefined) compilerContext.setCode(value)
}}
/>
</>
)
}
67 changes: 0 additions & 67 deletions src/lib/ui/editor/use-editor.ts

This file was deleted.

58 changes: 0 additions & 58 deletions src/lib/ui/highlight.tsx

This file was deleted.